<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><link rel="stylesheet" type="text/css" href="style.css" /><script type="text/javascript" src="highlight.js"></script></head><body><pre><span class="hs-pragma">{-# LANGUAGE BangPatterns #-}</span><span>
</span><span id="line-2"></span><span class="hs-pragma">{-# OPTIONS_GHC -Wno-incomplete-record-updates #-}</span><span>
</span><span id="line-3"></span><span class="hs-pragma">{-# OPTIONS_GHC -Wno-incomplete-uni-patterns   #-}</span><span>
</span><span id="line-4"></span><span>
</span><span id="line-5"></span><span class="hs-comment">-- | Tidying types and coercions for printing in error messages.</span><span>
</span><span id="line-6"></span><span class="hs-keyword">module</span><span> </span><span class="hs-identifier">GHC.Core.TyCo.Tidy</span><span>
</span><span id="line-7"></span><span>  </span><span class="hs-special">(</span><span>
</span><span id="line-8"></span><span>        </span><span class="annot"><span class="hs-comment">-- * Tidying type related things up for printing</span></span><span>
</span><span id="line-9"></span><span>        </span><span class="annot"><a href="GHC.Core.TyCo.Tidy.html#tidyType"><span class="hs-identifier">tidyType</span></a></span><span class="hs-special">,</span><span>      </span><span class="annot"><a href="GHC.Core.TyCo.Tidy.html#tidyTypes"><span class="hs-identifier">tidyTypes</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-10"></span><span>        </span><span class="annot"><a href="GHC.Core.TyCo.Tidy.html#tidyOpenType"><span class="hs-identifier">tidyOpenType</span></a></span><span class="hs-special">,</span><span>  </span><span class="annot"><a href="GHC.Core.TyCo.Tidy.html#tidyOpenTypes"><span class="hs-identifier">tidyOpenTypes</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-11"></span><span>        </span><span class="annot"><a href="GHC.Core.TyCo.Tidy.html#tidyOpenKind"><span class="hs-identifier">tidyOpenKind</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-12"></span><span>        </span><span class="annot"><a href="GHC.Core.TyCo.Tidy.html#tidyVarBndr"><span class="hs-identifier">tidyVarBndr</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Core.TyCo.Tidy.html#tidyVarBndrs"><span class="hs-identifier">tidyVarBndrs</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Core.TyCo.Tidy.html#tidyFreeTyCoVars"><span class="hs-identifier">tidyFreeTyCoVars</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Core.TyCo.Tidy.html#avoidNameClashes"><span class="hs-identifier">avoidNameClashes</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-13"></span><span>        </span><span class="annot"><a href="GHC.Core.TyCo.Tidy.html#tidyOpenTyCoVar"><span class="hs-identifier">tidyOpenTyCoVar</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Core.TyCo.Tidy.html#tidyOpenTyCoVars"><span class="hs-identifier">tidyOpenTyCoVars</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-14"></span><span>        </span><span class="annot"><a href="GHC.Core.TyCo.Tidy.html#tidyTyCoVarOcc"><span class="hs-identifier">tidyTyCoVarOcc</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-15"></span><span>        </span><span class="annot"><a href="GHC.Core.TyCo.Tidy.html#tidyTopType"><span class="hs-identifier">tidyTopType</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-16"></span><span>        </span><span class="annot"><a href="GHC.Core.TyCo.Tidy.html#tidyKind"><span class="hs-identifier">tidyKind</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-17"></span><span>        </span><span class="annot"><a href="GHC.Core.TyCo.Tidy.html#tidyCo"><span class="hs-identifier">tidyCo</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Core.TyCo.Tidy.html#tidyCos"><span class="hs-identifier">tidyCos</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-18"></span><span>        </span><span class="annot"><a href="GHC.Core.TyCo.Tidy.html#tidyTyCoVarBinder"><span class="hs-identifier">tidyTyCoVarBinder</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Core.TyCo.Tidy.html#tidyTyCoVarBinders"><span class="hs-identifier">tidyTyCoVarBinders</span></a></span><span>
</span><span id="line-19"></span><span>  </span><span class="hs-special">)</span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-20"></span><span>
</span><span id="line-21"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Prelude.html"><span class="hs-identifier">GHC.Prelude</span></a></span><span>
</span><span id="line-22"></span><span>
</span><span id="line-23"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Core.TyCo.Rep.html"><span class="hs-identifier">GHC.Core.TyCo.Rep</span></a></span><span>
</span><span id="line-24"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Core.TyCo.FVs.html"><span class="hs-identifier">GHC.Core.TyCo.FVs</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.TyCo.FVs.html#tyCoVarsOfTypesWellScoped"><span class="hs-identifier">tyCoVarsOfTypesWellScoped</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Core.TyCo.FVs.html#tyCoVarsOfTypeList"><span class="hs-identifier">tyCoVarsOfTypeList</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-25"></span><span>
</span><span id="line-26"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Types.Name.html"><span class="hs-identifier">GHC.Types.Name</span></a></span><span> </span><span class="hs-keyword">hiding</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.Name.Occurrence.html#varName"><span class="hs-identifier">varName</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-27"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Types.Var.html"><span class="hs-identifier">GHC.Types.Var</span></a></span><span>
</span><span id="line-28"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Types.Var.Env.html"><span class="hs-identifier">GHC.Types.Var.Env</span></a></span><span>
</span><span id="line-29"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Utils.Misc.html"><span class="hs-identifier">GHC.Utils.Misc</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Utils.Misc.html#seqList"><span class="hs-identifier">seqList</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-30"></span><span>
</span><span id="line-31"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../base/src/Data.List.html#"><span class="hs-identifier">Data.List</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/Data.Traversable.html#mapAccumL"><span class="hs-identifier">mapAccumL</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-32"></span><span>
</span><span id="line-33"></span><span class="hs-comment">{-
%************************************************************************
%*                                                                      *
\subsection{TidyType}
%*                                                                      *
%************************************************************************
-}</span><span>
</span><span id="line-40"></span><span>
</span><span id="line-41"></span><span class="hs-comment">-- | This tidies up a type for printing in an error message, or in</span><span>
</span><span id="line-42"></span><span class="hs-comment">-- an interface file.</span><span>
</span><span id="line-43"></span><span class="hs-comment">--</span><span>
</span><span id="line-44"></span><span class="hs-comment">-- It doesn't change the uniques at all, just the print names.</span><span>
</span><span id="line-45"></span><span class="annot"><a href="GHC.Core.TyCo.Tidy.html#tidyVarBndrs"><span class="hs-identifier hs-type">tidyVarBndrs</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Types.Var.Env.html#TidyEnv"><span class="hs-identifier hs-type">TidyEnv</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Types.Var.html#TyCoVar"><span class="hs-identifier hs-type">TyCoVar</span></a></span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.Var.Env.html#TidyEnv"><span class="hs-identifier hs-type">TidyEnv</span></a></span><span class="hs-special">,</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Types.Var.html#TyCoVar"><span class="hs-identifier hs-type">TyCoVar</span></a></span><span class="hs-special">]</span><span class="hs-special">)</span><span>
</span><span id="line-46"></span><span id="tidyVarBndrs"><span class="annot"><span class="annottext">tidyVarBndrs :: TidyEnv -&gt; [TyCoVar] -&gt; (TidyEnv, [TyCoVar])
</span><a href="GHC.Core.TyCo.Tidy.html#tidyVarBndrs"><span class="hs-identifier hs-var hs-var">tidyVarBndrs</span></a></span></span><span> </span><span id="local-6989586621680847579"><span class="annot"><span class="annottext">TidyEnv
</span><a href="#local-6989586621680847579"><span class="hs-identifier hs-var">tidy_env</span></a></span></span><span> </span><span id="local-6989586621680847578"><span class="annot"><span class="annottext">[TyCoVar]
</span><a href="#local-6989586621680847578"><span class="hs-identifier hs-var">tvs</span></a></span></span><span>
</span><span id="line-47"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(TidyEnv -&gt; TyCoVar -&gt; (TidyEnv, TyCoVar))
-&gt; TidyEnv -&gt; [TyCoVar] -&gt; (TidyEnv, [TyCoVar])
forall (t :: * -&gt; *) s a b.
Traversable t =&gt;
(s -&gt; a -&gt; (s, b)) -&gt; s -&gt; t a -&gt; (s, t b)
</span><a href="../../base/src/Data.Traversable.html#mapAccumL"><span class="hs-identifier hs-var">mapAccumL</span></a></span><span> </span><span class="annot"><span class="annottext">TidyEnv -&gt; TyCoVar -&gt; (TidyEnv, TyCoVar)
</span><a href="GHC.Core.TyCo.Tidy.html#tidyVarBndr"><span class="hs-identifier hs-var">tidyVarBndr</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[TyCoVar] -&gt; TidyEnv -&gt; TidyEnv
</span><a href="GHC.Core.TyCo.Tidy.html#avoidNameClashes"><span class="hs-identifier hs-var">avoidNameClashes</span></a></span><span> </span><span class="annot"><span class="annottext">[TyCoVar]
</span><a href="#local-6989586621680847578"><span class="hs-identifier hs-var">tvs</span></a></span><span> </span><span class="annot"><span class="annottext">TidyEnv
</span><a href="#local-6989586621680847579"><span class="hs-identifier hs-var">tidy_env</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">[TyCoVar]
</span><a href="#local-6989586621680847578"><span class="hs-identifier hs-var">tvs</span></a></span><span>
</span><span id="line-48"></span><span>
</span><span id="line-49"></span><span class="annot"><a href="GHC.Core.TyCo.Tidy.html#tidyVarBndr"><span class="hs-identifier hs-type">tidyVarBndr</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Types.Var.Env.html#TidyEnv"><span class="hs-identifier hs-type">TidyEnv</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Types.Var.html#TyCoVar"><span class="hs-identifier hs-type">TyCoVar</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.Var.Env.html#TidyEnv"><span class="hs-identifier hs-type">TidyEnv</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Types.Var.html#TyCoVar"><span class="hs-identifier hs-type">TyCoVar</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-50"></span><span id="tidyVarBndr"><span class="annot"><span class="annottext">tidyVarBndr :: TidyEnv -&gt; TyCoVar -&gt; (TidyEnv, TyCoVar)
</span><a href="GHC.Core.TyCo.Tidy.html#tidyVarBndr"><span class="hs-identifier hs-var hs-var">tidyVarBndr</span></a></span></span><span> </span><span id="local-6989586621680847577"><span class="annot"><span class="annottext">tidy_env :: TidyEnv
</span><a href="#local-6989586621680847577"><span class="hs-identifier hs-var">tidy_env</span></a></span></span><span class="hs-glyph">@</span><span class="hs-special">(</span><span id="local-6989586621680847576"><span class="annot"><span class="annottext">TidyOccEnv
</span><a href="#local-6989586621680847576"><span class="hs-identifier hs-var">occ_env</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621680847575"><span class="annot"><span class="annottext">VarEnv TyCoVar
</span><a href="#local-6989586621680847575"><span class="hs-identifier hs-var">subst</span></a></span></span><span class="hs-special">)</span><span> </span><span id="local-6989586621680847574"><span class="annot"><span class="annottext">TyCoVar
</span><a href="#local-6989586621680847574"><span class="hs-identifier hs-var">var</span></a></span></span><span>
</span><span id="line-51"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">TidyOccEnv -&gt; OccName -&gt; (TidyOccEnv, OccName)
</span><a href="GHC.Types.Name.Occurrence.html#tidyOccName"><span class="hs-identifier hs-var">tidyOccName</span></a></span><span> </span><span class="annot"><span class="annottext">TidyOccEnv
</span><a href="#local-6989586621680847576"><span class="hs-identifier hs-var">occ_env</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">TyCoVar -&gt; OccName
</span><a href="GHC.Core.TyCo.Tidy.html#getHelpfulOccName"><span class="hs-identifier hs-var">getHelpfulOccName</span></a></span><span> </span><span class="annot"><span class="annottext">TyCoVar
</span><a href="#local-6989586621680847574"><span class="hs-identifier hs-var">var</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-52"></span><span>      </span><span class="hs-special">(</span><span id="local-6989586621680847571"><span class="annot"><span class="annottext">TidyOccEnv
</span><a href="#local-6989586621680847571"><span class="hs-identifier hs-var">occ_env'</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621680847570"><span class="annot"><span class="annottext">OccName
</span><a href="#local-6989586621680847570"><span class="hs-identifier hs-var">occ'</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="hs-special">(</span><span class="annot"><span class="annottext">TidyOccEnv
</span><a href="#local-6989586621680847571"><span class="hs-identifier hs-var">occ_env'</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">VarEnv TyCoVar
</span><a href="#local-6989586621680847569"><span class="hs-identifier hs-var">subst'</span></a></span><span class="hs-special">)</span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">TyCoVar
</span><a href="#local-6989586621680847568"><span class="hs-identifier hs-var">var'</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-53"></span><span>        </span><span class="hs-keyword">where</span><span>
</span><span id="line-54"></span><span>          </span><span id="local-6989586621680847569"><span class="annot"><span class="annottext">subst' :: VarEnv TyCoVar
</span><a href="#local-6989586621680847569"><span class="hs-identifier hs-var hs-var">subst'</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">VarEnv TyCoVar -&gt; TyCoVar -&gt; TyCoVar -&gt; VarEnv TyCoVar
forall a. VarEnv a -&gt; TyCoVar -&gt; a -&gt; VarEnv a
</span><a href="GHC.Types.Var.Env.html#extendVarEnv"><span class="hs-identifier hs-var">extendVarEnv</span></a></span><span> </span><span class="annot"><span class="annottext">VarEnv TyCoVar
</span><a href="#local-6989586621680847575"><span class="hs-identifier hs-var">subst</span></a></span><span> </span><span class="annot"><span class="annottext">TyCoVar
</span><a href="#local-6989586621680847574"><span class="hs-identifier hs-var">var</span></a></span><span> </span><span class="annot"><span class="annottext">TyCoVar
</span><a href="#local-6989586621680847568"><span class="hs-identifier hs-var">var'</span></a></span><span>
</span><span id="line-55"></span><span>          </span><span id="local-6989586621680847568"><span class="annot"><span class="annottext">var' :: TyCoVar
</span><a href="#local-6989586621680847568"><span class="hs-identifier hs-var hs-var">var'</span></a></span></span><span>   </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(Type -&gt; Type) -&gt; TyCoVar -&gt; TyCoVar
</span><a href="GHC.Types.Var.html#updateVarType"><span class="hs-identifier hs-var">updateVarType</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">TidyEnv -&gt; Type -&gt; Type
</span><a href="GHC.Core.TyCo.Tidy.html#tidyType"><span class="hs-identifier hs-var">tidyType</span></a></span><span> </span><span class="annot"><span class="annottext">TidyEnv
</span><a href="#local-6989586621680847577"><span class="hs-identifier hs-var">tidy_env</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">TyCoVar -&gt; Name -&gt; TyCoVar
</span><a href="GHC.Types.Var.html#setVarName"><span class="hs-identifier hs-var">setVarName</span></a></span><span> </span><span class="annot"><span class="annottext">TyCoVar
</span><a href="#local-6989586621680847574"><span class="hs-identifier hs-var">var</span></a></span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621680847564"><span class="hs-identifier hs-var">name'</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-56"></span><span>          </span><span id="local-6989586621680847564"><span class="annot"><span class="annottext">name' :: Name
</span><a href="#local-6989586621680847564"><span class="hs-identifier hs-var hs-var">name'</span></a></span></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Name -&gt; OccName -&gt; Name
</span><a href="GHC.Types.Name.html#tidyNameOcc"><span class="hs-identifier hs-var">tidyNameOcc</span></a></span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621680847562"><span class="hs-identifier hs-var">name</span></a></span><span> </span><span class="annot"><span class="annottext">OccName
</span><a href="#local-6989586621680847570"><span class="hs-identifier hs-var">occ'</span></a></span><span>
</span><span id="line-57"></span><span>          </span><span id="local-6989586621680847562"><span class="annot"><span class="annottext">name :: Name
</span><a href="#local-6989586621680847562"><span class="hs-identifier hs-var hs-var">name</span></a></span></span><span>   </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">TyCoVar -&gt; Name
</span><a href="GHC.Types.Var.html#varName"><span class="hs-identifier hs-var hs-var">varName</span></a></span><span> </span><span class="annot"><span class="annottext">TyCoVar
</span><a href="#local-6989586621680847574"><span class="hs-identifier hs-var">var</span></a></span><span>
</span><span id="line-58"></span><span>
</span><span id="line-59"></span><span class="annot"><a href="GHC.Core.TyCo.Tidy.html#avoidNameClashes"><span class="hs-identifier hs-type">avoidNameClashes</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Types.Var.html#TyCoVar"><span class="hs-identifier hs-type">TyCoVar</span></a></span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Types.Var.Env.html#TidyEnv"><span class="hs-identifier hs-type">TidyEnv</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Types.Var.Env.html#TidyEnv"><span class="hs-identifier hs-type">TidyEnv</span></a></span><span>
</span><span id="line-60"></span><span class="hs-comment">-- Seed the occ_env with clashes among the names, see</span><span>
</span><span id="line-61"></span><span class="hs-comment">-- Note [Tidying multiple names at once] in GHC.Types.Names.OccName</span><span>
</span><span id="line-62"></span><span id="avoidNameClashes"><span class="annot"><span class="annottext">avoidNameClashes :: [TyCoVar] -&gt; TidyEnv -&gt; TidyEnv
</span><a href="GHC.Core.TyCo.Tidy.html#avoidNameClashes"><span class="hs-identifier hs-var hs-var">avoidNameClashes</span></a></span></span><span> </span><span id="local-6989586621680847560"><span class="annot"><span class="annottext">[TyCoVar]
</span><a href="#local-6989586621680847560"><span class="hs-identifier hs-var">tvs</span></a></span></span><span> </span><span class="hs-special">(</span><span id="local-6989586621680847559"><span class="annot"><span class="annottext">TidyOccEnv
</span><a href="#local-6989586621680847559"><span class="hs-identifier hs-var">occ_env</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621680847558"><span class="annot"><span class="annottext">VarEnv TyCoVar
</span><a href="#local-6989586621680847558"><span class="hs-identifier hs-var">subst</span></a></span></span><span class="hs-special">)</span><span>
</span><span id="line-63"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">TidyOccEnv -&gt; [OccName] -&gt; TidyOccEnv
</span><a href="GHC.Types.Name.Occurrence.html#avoidClashesOccEnv"><span class="hs-identifier hs-var">avoidClashesOccEnv</span></a></span><span> </span><span class="annot"><span class="annottext">TidyOccEnv
</span><a href="#local-6989586621680847559"><span class="hs-identifier hs-var">occ_env</span></a></span><span> </span><span class="annot"><span class="annottext">[OccName]
</span><a href="#local-6989586621680847556"><span class="hs-identifier hs-var">occs</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">VarEnv TyCoVar
</span><a href="#local-6989586621680847558"><span class="hs-identifier hs-var">subst</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-64"></span><span>  </span><span class="hs-keyword">where</span><span>
</span><span id="line-65"></span><span>    </span><span id="local-6989586621680847556"><span class="annot"><span class="annottext">occs :: [OccName]
</span><a href="#local-6989586621680847556"><span class="hs-identifier hs-var hs-var">occs</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(TyCoVar -&gt; OccName) -&gt; [TyCoVar] -&gt; [OccName]
forall a b. (a -&gt; b) -&gt; [a] -&gt; [b]
</span><a href="../../base/src/GHC.Base.html#map"><span class="hs-identifier hs-var">map</span></a></span><span> </span><span class="annot"><span class="annottext">TyCoVar -&gt; OccName
</span><a href="GHC.Core.TyCo.Tidy.html#getHelpfulOccName"><span class="hs-identifier hs-var">getHelpfulOccName</span></a></span><span> </span><span class="annot"><span class="annottext">[TyCoVar]
</span><a href="#local-6989586621680847560"><span class="hs-identifier hs-var">tvs</span></a></span><span>
</span><span id="line-66"></span><span>
</span><span id="line-67"></span><span class="annot"><a href="GHC.Core.TyCo.Tidy.html#getHelpfulOccName"><span class="hs-identifier hs-type">getHelpfulOccName</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Types.Var.html#TyCoVar"><span class="hs-identifier hs-type">TyCoVar</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Types.Name.Occurrence.html#OccName"><span class="hs-identifier hs-type">OccName</span></a></span><span>
</span><span id="line-68"></span><span class="hs-comment">-- A TcTyVar with a System Name is probably a</span><span>
</span><span id="line-69"></span><span class="hs-comment">-- unification variable; when we tidy them we give them a trailing</span><span>
</span><span id="line-70"></span><span class="hs-comment">-- &quot;0&quot; (or 1 etc) so that they don't take precedence for the</span><span>
</span><span id="line-71"></span><span class="hs-comment">-- un-modified name. Plus, indicating a unification variable in</span><span>
</span><span id="line-72"></span><span class="hs-comment">-- this way is a helpful clue for users</span><span>
</span><span id="line-73"></span><span id="getHelpfulOccName"><span class="annot"><span class="annottext">getHelpfulOccName :: TyCoVar -&gt; OccName
</span><a href="GHC.Core.TyCo.Tidy.html#getHelpfulOccName"><span class="hs-identifier hs-var hs-var">getHelpfulOccName</span></a></span></span><span> </span><span id="local-6989586621680847555"><span class="annot"><span class="annottext">TyCoVar
</span><a href="#local-6989586621680847555"><span class="hs-identifier hs-var">tv</span></a></span></span><span>
</span><span id="line-74"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Name -&gt; Bool
</span><a href="GHC.Types.Name.html#isSystemName"><span class="hs-identifier hs-var">isSystemName</span></a></span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621680847553"><span class="hs-identifier hs-var">name</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">TyCoVar -&gt; Bool
</span><a href="GHC.Types.Var.html#isTcTyVar"><span class="hs-identifier hs-var">isTcTyVar</span></a></span><span> </span><span class="annot"><span class="annottext">TyCoVar
</span><a href="#local-6989586621680847555"><span class="hs-identifier hs-var">tv</span></a></span><span>
</span><span id="line-75"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String -&gt; OccName
</span><a href="GHC.Types.Name.Occurrence.html#mkTyVarOcc"><span class="hs-identifier hs-var">mkTyVarOcc</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">OccName -&gt; String
</span><a href="GHC.Types.Name.Occurrence.html#occNameString"><span class="hs-identifier hs-var">occNameString</span></a></span><span> </span><span class="annot"><span class="annottext">OccName
</span><a href="#local-6989586621680847549"><span class="hs-identifier hs-var">occ</span></a></span><span> </span><span class="annot"><span class="annottext">String -&gt; String -&gt; String
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;0&quot;</span></span><span class="hs-special">)</span><span>
</span><span id="line-76"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../base/src/GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span>
</span><span id="line-77"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">OccName
</span><a href="#local-6989586621680847549"><span class="hs-identifier hs-var">occ</span></a></span><span>
</span><span id="line-78"></span><span>  </span><span class="hs-keyword">where</span><span>
</span><span id="line-79"></span><span>   </span><span id="local-6989586621680847553"><span class="annot"><span class="annottext">name :: Name
</span><a href="#local-6989586621680847553"><span class="hs-identifier hs-var hs-var">name</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">TyCoVar -&gt; Name
</span><a href="GHC.Types.Var.html#varName"><span class="hs-identifier hs-var hs-var">varName</span></a></span><span> </span><span class="annot"><span class="annottext">TyCoVar
</span><a href="#local-6989586621680847555"><span class="hs-identifier hs-var">tv</span></a></span><span>
</span><span id="line-80"></span><span>   </span><span id="local-6989586621680847549"><span class="annot"><span class="annottext">occ :: OccName
</span><a href="#local-6989586621680847549"><span class="hs-identifier hs-var hs-var">occ</span></a></span></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Name -&gt; OccName
forall a. NamedThing a =&gt; a -&gt; OccName
</span><a href="GHC.Types.Name.html#getOccName"><span class="hs-identifier hs-var">getOccName</span></a></span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621680847553"><span class="hs-identifier hs-var">name</span></a></span><span>
</span><span id="line-81"></span><span>
</span><span id="line-82"></span><span id="local-6989586621680847646"><span class="annot"><a href="GHC.Core.TyCo.Tidy.html#tidyTyCoVarBinder"><span class="hs-identifier hs-type">tidyTyCoVarBinder</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Types.Var.Env.html#TidyEnv"><span class="hs-identifier hs-type">TidyEnv</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Types.Var.html#VarBndr"><span class="hs-identifier hs-type">VarBndr</span></a></span><span> </span><span class="annot"><a href="GHC.Types.Var.html#TyCoVar"><span class="hs-identifier hs-type">TyCoVar</span></a></span><span> </span><span class="annot"><a href="#local-6989586621680847646"><span class="hs-identifier hs-type">vis</span></a></span><span>
</span><span id="line-83"></span><span>                  </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.Var.Env.html#TidyEnv"><span class="hs-identifier hs-type">TidyEnv</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Types.Var.html#VarBndr"><span class="hs-identifier hs-type">VarBndr</span></a></span><span> </span><span class="annot"><a href="GHC.Types.Var.html#TyCoVar"><span class="hs-identifier hs-type">TyCoVar</span></a></span><span> </span><span class="annot"><a href="#local-6989586621680847646"><span class="hs-identifier hs-type">vis</span></a></span><span class="hs-special">)</span></span><span>
</span><span id="line-84"></span><span id="tidyTyCoVarBinder"><span class="annot"><span class="annottext">tidyTyCoVarBinder :: forall vis.
TidyEnv -&gt; VarBndr TyCoVar vis -&gt; (TidyEnv, VarBndr TyCoVar vis)
</span><a href="GHC.Core.TyCo.Tidy.html#tidyTyCoVarBinder"><span class="hs-identifier hs-var hs-var">tidyTyCoVarBinder</span></a></span></span><span> </span><span id="local-6989586621680847545"><span class="annot"><span class="annottext">TidyEnv
</span><a href="#local-6989586621680847545"><span class="hs-identifier hs-var">tidy_env</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.Var.html#Bndr"><span class="hs-identifier hs-type">Bndr</span></a></span><span> </span><span id="local-6989586621680847543"><span class="annot"><span class="annottext">TyCoVar
</span><a href="#local-6989586621680847543"><span class="hs-identifier hs-var">tv</span></a></span></span><span> </span><span id="local-6989586621680847542"><span class="annot"><span class="annottext">vis
</span><a href="#local-6989586621680847542"><span class="hs-identifier hs-var">vis</span></a></span></span><span class="hs-special">)</span><span>
</span><span id="line-85"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">TidyEnv
</span><a href="#local-6989586621680847541"><span class="hs-identifier hs-var">tidy_env'</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">TyCoVar -&gt; vis -&gt; VarBndr TyCoVar vis
forall var argf. var -&gt; argf -&gt; VarBndr var argf
</span><a href="GHC.Types.Var.html#Bndr"><span class="hs-identifier hs-var">Bndr</span></a></span><span> </span><span class="annot"><span class="annottext">TyCoVar
</span><a href="#local-6989586621680847540"><span class="hs-identifier hs-var">tv'</span></a></span><span> </span><span class="annot"><span class="annottext">vis
</span><a href="#local-6989586621680847542"><span class="hs-identifier hs-var">vis</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-86"></span><span>  </span><span class="hs-keyword">where</span><span>
</span><span id="line-87"></span><span>    </span><span class="hs-special">(</span><span id="local-6989586621680847541"><span class="annot"><span class="annottext">TidyEnv
</span><a href="#local-6989586621680847541"><span class="hs-identifier hs-var">tidy_env'</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621680847540"><span class="annot"><span class="annottext">TyCoVar
</span><a href="#local-6989586621680847540"><span class="hs-identifier hs-var">tv'</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">TidyEnv -&gt; TyCoVar -&gt; (TidyEnv, TyCoVar)
</span><a href="GHC.Core.TyCo.Tidy.html#tidyVarBndr"><span class="hs-identifier hs-var">tidyVarBndr</span></a></span><span> </span><span class="annot"><span class="annottext">TidyEnv
</span><a href="#local-6989586621680847545"><span class="hs-identifier hs-var">tidy_env</span></a></span><span> </span><span class="annot"><span class="annottext">TyCoVar
</span><a href="#local-6989586621680847543"><span class="hs-identifier hs-var">tv</span></a></span><span>
</span><span id="line-88"></span><span>
</span><span id="line-89"></span><span id="local-6989586621680847641"><span class="annot"><a href="GHC.Core.TyCo.Tidy.html#tidyTyCoVarBinders"><span class="hs-identifier hs-type">tidyTyCoVarBinders</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Types.Var.Env.html#TidyEnv"><span class="hs-identifier hs-type">TidyEnv</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Types.Var.html#VarBndr"><span class="hs-identifier hs-type">VarBndr</span></a></span><span> </span><span class="annot"><a href="GHC.Types.Var.html#TyCoVar"><span class="hs-identifier hs-type">TyCoVar</span></a></span><span> </span><span class="annot"><a href="#local-6989586621680847641"><span class="hs-identifier hs-type">vis</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-90"></span><span>                   </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.Var.Env.html#TidyEnv"><span class="hs-identifier hs-type">TidyEnv</span></a></span><span class="hs-special">,</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Types.Var.html#VarBndr"><span class="hs-identifier hs-type">VarBndr</span></a></span><span> </span><span class="annot"><a href="GHC.Types.Var.html#TyCoVar"><span class="hs-identifier hs-type">TyCoVar</span></a></span><span> </span><span class="annot"><a href="#local-6989586621680847641"><span class="hs-identifier hs-type">vis</span></a></span><span class="hs-special">]</span><span class="hs-special">)</span></span><span>
</span><span id="line-91"></span><span id="tidyTyCoVarBinders"><span class="annot"><span class="annottext">tidyTyCoVarBinders :: forall vis.
TidyEnv
-&gt; [VarBndr TyCoVar vis] -&gt; (TidyEnv, [VarBndr TyCoVar vis])
</span><a href="GHC.Core.TyCo.Tidy.html#tidyTyCoVarBinders"><span class="hs-identifier hs-var hs-var">tidyTyCoVarBinders</span></a></span></span><span> </span><span id="local-6989586621680847538"><span class="annot"><span class="annottext">TidyEnv
</span><a href="#local-6989586621680847538"><span class="hs-identifier hs-var">tidy_env</span></a></span></span><span> </span><span id="local-6989586621680847537"><span class="annot"><span class="annottext">[VarBndr TyCoVar vis]
</span><a href="#local-6989586621680847537"><span class="hs-identifier hs-var">tvbs</span></a></span></span><span>
</span><span id="line-92"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(TidyEnv -&gt; VarBndr TyCoVar vis -&gt; (TidyEnv, VarBndr TyCoVar vis))
-&gt; TidyEnv
-&gt; [VarBndr TyCoVar vis]
-&gt; (TidyEnv, [VarBndr TyCoVar vis])
forall (t :: * -&gt; *) s a b.
Traversable t =&gt;
(s -&gt; a -&gt; (s, b)) -&gt; s -&gt; t a -&gt; (s, t b)
</span><a href="../../base/src/Data.Traversable.html#mapAccumL"><span class="hs-identifier hs-var">mapAccumL</span></a></span><span> </span><span class="annot"><span class="annottext">TidyEnv -&gt; VarBndr TyCoVar vis -&gt; (TidyEnv, VarBndr TyCoVar vis)
forall vis.
TidyEnv -&gt; VarBndr TyCoVar vis -&gt; (TidyEnv, VarBndr TyCoVar vis)
</span><a href="GHC.Core.TyCo.Tidy.html#tidyTyCoVarBinder"><span class="hs-identifier hs-var">tidyTyCoVarBinder</span></a></span><span>
</span><span id="line-93"></span><span>              </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[TyCoVar] -&gt; TidyEnv -&gt; TidyEnv
</span><a href="GHC.Core.TyCo.Tidy.html#avoidNameClashes"><span class="hs-identifier hs-var">avoidNameClashes</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[VarBndr TyCoVar vis] -&gt; [TyCoVar]
forall tv argf. [VarBndr tv argf] -&gt; [tv]
</span><a href="GHC.Types.Var.html#binderVars"><span class="hs-identifier hs-var">binderVars</span></a></span><span> </span><span class="annot"><span class="annottext">[VarBndr TyCoVar vis]
</span><a href="#local-6989586621680847537"><span class="hs-identifier hs-var">tvbs</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">TidyEnv
</span><a href="#local-6989586621680847538"><span class="hs-identifier hs-var">tidy_env</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">[VarBndr TyCoVar vis]
</span><a href="#local-6989586621680847537"><span class="hs-identifier hs-var">tvbs</span></a></span><span>
</span><span id="line-94"></span><span>
</span><span id="line-95"></span><span class="hs-comment">---------------</span><span>
</span><span id="line-96"></span><span class="annot"><a href="GHC.Core.TyCo.Tidy.html#tidyFreeTyCoVars"><span class="hs-identifier hs-type">tidyFreeTyCoVars</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Types.Var.Env.html#TidyEnv"><span class="hs-identifier hs-type">TidyEnv</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Types.Var.html#TyCoVar"><span class="hs-identifier hs-type">TyCoVar</span></a></span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Types.Var.Env.html#TidyEnv"><span class="hs-identifier hs-type">TidyEnv</span></a></span><span>
</span><span id="line-97"></span><span class="hs-comment">-- ^ Add the free 'TyVar's to the env in tidy form,</span><span>
</span><span id="line-98"></span><span class="hs-comment">-- so that we can tidy the type they are free in</span><span>
</span><span id="line-99"></span><span id="tidyFreeTyCoVars"><span class="annot"><span class="annottext">tidyFreeTyCoVars :: TidyEnv -&gt; [TyCoVar] -&gt; TidyEnv
</span><a href="GHC.Core.TyCo.Tidy.html#tidyFreeTyCoVars"><span class="hs-identifier hs-var hs-var">tidyFreeTyCoVars</span></a></span></span><span> </span><span id="local-6989586621680847535"><span class="annot"><span class="annottext">TidyEnv
</span><a href="#local-6989586621680847535"><span class="hs-identifier hs-var">tidy_env</span></a></span></span><span> </span><span id="local-6989586621680847534"><span class="annot"><span class="annottext">[TyCoVar]
</span><a href="#local-6989586621680847534"><span class="hs-identifier hs-var">tyvars</span></a></span></span><span>
</span><span id="line-100"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(TidyEnv, [TyCoVar]) -&gt; TidyEnv
forall a b. (a, b) -&gt; a
</span><a href="../../base/src/Data.Tuple.html#fst"><span class="hs-identifier hs-var">fst</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">TidyEnv -&gt; [TyCoVar] -&gt; (TidyEnv, [TyCoVar])
</span><a href="GHC.Core.TyCo.Tidy.html#tidyOpenTyCoVars"><span class="hs-identifier hs-var">tidyOpenTyCoVars</span></a></span><span> </span><span class="annot"><span class="annottext">TidyEnv
</span><a href="#local-6989586621680847535"><span class="hs-identifier hs-var">tidy_env</span></a></span><span> </span><span class="annot"><span class="annottext">[TyCoVar]
</span><a href="#local-6989586621680847534"><span class="hs-identifier hs-var">tyvars</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-101"></span><span>
</span><span id="line-102"></span><span class="hs-comment">---------------</span><span>
</span><span id="line-103"></span><span class="annot"><a href="GHC.Core.TyCo.Tidy.html#tidyOpenTyCoVars"><span class="hs-identifier hs-type">tidyOpenTyCoVars</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Types.Var.Env.html#TidyEnv"><span class="hs-identifier hs-type">TidyEnv</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Types.Var.html#TyCoVar"><span class="hs-identifier hs-type">TyCoVar</span></a></span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.Var.Env.html#TidyEnv"><span class="hs-identifier hs-type">TidyEnv</span></a></span><span class="hs-special">,</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Types.Var.html#TyCoVar"><span class="hs-identifier hs-type">TyCoVar</span></a></span><span class="hs-special">]</span><span class="hs-special">)</span><span>
</span><span id="line-104"></span><span id="tidyOpenTyCoVars"><span class="annot"><span class="annottext">tidyOpenTyCoVars :: TidyEnv -&gt; [TyCoVar] -&gt; (TidyEnv, [TyCoVar])
</span><a href="GHC.Core.TyCo.Tidy.html#tidyOpenTyCoVars"><span class="hs-identifier hs-var hs-var">tidyOpenTyCoVars</span></a></span></span><span> </span><span id="local-6989586621680847533"><span class="annot"><span class="annottext">TidyEnv
</span><a href="#local-6989586621680847533"><span class="hs-identifier hs-var">env</span></a></span></span><span> </span><span id="local-6989586621680847532"><span class="annot"><span class="annottext">[TyCoVar]
</span><a href="#local-6989586621680847532"><span class="hs-identifier hs-var">tyvars</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(TidyEnv -&gt; TyCoVar -&gt; (TidyEnv, TyCoVar))
-&gt; TidyEnv -&gt; [TyCoVar] -&gt; (TidyEnv, [TyCoVar])
forall (t :: * -&gt; *) s a b.
Traversable t =&gt;
(s -&gt; a -&gt; (s, b)) -&gt; s -&gt; t a -&gt; (s, t b)
</span><a href="../../base/src/Data.Traversable.html#mapAccumL"><span class="hs-identifier hs-var">mapAccumL</span></a></span><span> </span><span class="annot"><span class="annottext">TidyEnv -&gt; TyCoVar -&gt; (TidyEnv, TyCoVar)
</span><a href="GHC.Core.TyCo.Tidy.html#tidyOpenTyCoVar"><span class="hs-identifier hs-var">tidyOpenTyCoVar</span></a></span><span> </span><span class="annot"><span class="annottext">TidyEnv
</span><a href="#local-6989586621680847533"><span class="hs-identifier hs-var">env</span></a></span><span> </span><span class="annot"><span class="annottext">[TyCoVar]
</span><a href="#local-6989586621680847532"><span class="hs-identifier hs-var">tyvars</span></a></span><span>
</span><span id="line-105"></span><span>
</span><span id="line-106"></span><span class="hs-comment">---------------</span><span>
</span><span id="line-107"></span><span class="annot"><a href="GHC.Core.TyCo.Tidy.html#tidyOpenTyCoVar"><span class="hs-identifier hs-type">tidyOpenTyCoVar</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Types.Var.Env.html#TidyEnv"><span class="hs-identifier hs-type">TidyEnv</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Types.Var.html#TyCoVar"><span class="hs-identifier hs-type">TyCoVar</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.Var.Env.html#TidyEnv"><span class="hs-identifier hs-type">TidyEnv</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Types.Var.html#TyCoVar"><span class="hs-identifier hs-type">TyCoVar</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-108"></span><span class="hs-comment">-- ^ Treat a new 'TyCoVar' as a binder, and give it a fresh tidy name</span><span>
</span><span id="line-109"></span><span class="hs-comment">-- using the environment if one has not already been allocated. See</span><span>
</span><span id="line-110"></span><span class="hs-comment">-- also 'tidyVarBndr'</span><span>
</span><span id="line-111"></span><span id="tidyOpenTyCoVar"><span class="annot"><span class="annottext">tidyOpenTyCoVar :: TidyEnv -&gt; TyCoVar -&gt; (TidyEnv, TyCoVar)
</span><a href="GHC.Core.TyCo.Tidy.html#tidyOpenTyCoVar"><span class="hs-identifier hs-var hs-var">tidyOpenTyCoVar</span></a></span></span><span> </span><span id="local-6989586621680847531"><span class="annot"><span class="annottext">env :: TidyEnv
</span><a href="#local-6989586621680847531"><span class="hs-identifier hs-var">env</span></a></span></span><span class="hs-glyph">@</span><span class="hs-special">(</span><span class="annot"><span class="annottext">TidyOccEnv
</span><span class="hs-identifier">_</span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621680847530"><span class="annot"><span class="annottext">VarEnv TyCoVar
</span><a href="#local-6989586621680847530"><span class="hs-identifier hs-var">subst</span></a></span></span><span class="hs-special">)</span><span> </span><span id="local-6989586621680847529"><span class="annot"><span class="annottext">TyCoVar
</span><a href="#local-6989586621680847529"><span class="hs-identifier hs-var">tyvar</span></a></span></span><span>
</span><span id="line-112"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">VarEnv TyCoVar -&gt; TyCoVar -&gt; Maybe TyCoVar
forall a. VarEnv a -&gt; TyCoVar -&gt; Maybe a
</span><a href="GHC.Types.Var.Env.html#lookupVarEnv"><span class="hs-identifier hs-var">lookupVarEnv</span></a></span><span> </span><span class="annot"><span class="annottext">VarEnv TyCoVar
</span><a href="#local-6989586621680847530"><span class="hs-identifier hs-var">subst</span></a></span><span> </span><span class="annot"><span class="annottext">TyCoVar
</span><a href="#local-6989586621680847529"><span class="hs-identifier hs-var">tyvar</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-113"></span><span>        </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-type">Just</span></a></span><span> </span><span id="local-6989586621680847527"><span class="annot"><span class="annottext">TyCoVar
</span><a href="#local-6989586621680847527"><span class="hs-identifier hs-var">tyvar'</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">TidyEnv
</span><a href="#local-6989586621680847531"><span class="hs-identifier hs-var">env</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">TyCoVar
</span><a href="#local-6989586621680847527"><span class="hs-identifier hs-var">tyvar'</span></a></span><span class="hs-special">)</span><span>              </span><span class="hs-comment">-- Already substituted</span><span>
</span><span id="line-114"></span><span>        </span><span class="annot"><span class="annottext">Maybe TyCoVar
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span>     </span><span class="hs-glyph">-&gt;</span><span>
</span><span id="line-115"></span><span>          </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621680847526"><span class="annot"><span class="annottext">env' :: TidyEnv
</span><a href="#local-6989586621680847526"><span class="hs-identifier hs-var hs-var">env'</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">TidyEnv -&gt; [TyCoVar] -&gt; TidyEnv
</span><a href="GHC.Core.TyCo.Tidy.html#tidyFreeTyCoVars"><span class="hs-identifier hs-var">tidyFreeTyCoVars</span></a></span><span> </span><span class="annot"><span class="annottext">TidyEnv
</span><a href="#local-6989586621680847531"><span class="hs-identifier hs-var">env</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Type -&gt; [TyCoVar]
</span><a href="GHC.Core.TyCo.FVs.html#tyCoVarsOfTypeList"><span class="hs-identifier hs-var">tyCoVarsOfTypeList</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">TyCoVar -&gt; Type
</span><a href="GHC.Types.Var.html#tyVarKind"><span class="hs-identifier hs-var">tyVarKind</span></a></span><span> </span><span class="annot"><span class="annottext">TyCoVar
</span><a href="#local-6989586621680847529"><span class="hs-identifier hs-var">tyvar</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-116"></span><span>          </span><span class="hs-keyword">in</span><span> </span><span class="annot"><span class="annottext">TidyEnv -&gt; TyCoVar -&gt; (TidyEnv, TyCoVar)
</span><a href="GHC.Core.TyCo.Tidy.html#tidyVarBndr"><span class="hs-identifier hs-var">tidyVarBndr</span></a></span><span> </span><span class="annot"><span class="annottext">TidyEnv
</span><a href="#local-6989586621680847526"><span class="hs-identifier hs-var">env'</span></a></span><span> </span><span class="annot"><span class="annottext">TyCoVar
</span><a href="#local-6989586621680847529"><span class="hs-identifier hs-var">tyvar</span></a></span><span>  </span><span class="hs-comment">-- Treat it as a binder</span><span>
</span><span id="line-117"></span><span>
</span><span id="line-118"></span><span class="hs-comment">---------------</span><span>
</span><span id="line-119"></span><span class="annot"><a href="GHC.Core.TyCo.Tidy.html#tidyTyCoVarOcc"><span class="hs-identifier hs-type">tidyTyCoVarOcc</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Types.Var.Env.html#TidyEnv"><span class="hs-identifier hs-type">TidyEnv</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Types.Var.html#TyCoVar"><span class="hs-identifier hs-type">TyCoVar</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Types.Var.html#TyCoVar"><span class="hs-identifier hs-type">TyCoVar</span></a></span><span>
</span><span id="line-120"></span><span id="tidyTyCoVarOcc"><span class="annot"><span class="annottext">tidyTyCoVarOcc :: TidyEnv -&gt; TyCoVar -&gt; TyCoVar
</span><a href="GHC.Core.TyCo.Tidy.html#tidyTyCoVarOcc"><span class="hs-identifier hs-var hs-var">tidyTyCoVarOcc</span></a></span></span><span> </span><span id="local-6989586621680847524"><span class="annot"><span class="annottext">env :: TidyEnv
</span><a href="#local-6989586621680847524"><span class="hs-identifier hs-var">env</span></a></span></span><span class="hs-glyph">@</span><span class="hs-special">(</span><span class="annot"><span class="annottext">TidyOccEnv
</span><span class="hs-identifier">_</span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621680847523"><span class="annot"><span class="annottext">VarEnv TyCoVar
</span><a href="#local-6989586621680847523"><span class="hs-identifier hs-var">subst</span></a></span></span><span class="hs-special">)</span><span> </span><span id="local-6989586621680847522"><span class="annot"><span class="annottext">TyCoVar
</span><a href="#local-6989586621680847522"><span class="hs-identifier hs-var">tv</span></a></span></span><span>
</span><span id="line-121"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">VarEnv TyCoVar -&gt; TyCoVar -&gt; Maybe TyCoVar
forall a. VarEnv a -&gt; TyCoVar -&gt; Maybe a
</span><a href="GHC.Types.Var.Env.html#lookupVarEnv"><span class="hs-identifier hs-var">lookupVarEnv</span></a></span><span> </span><span class="annot"><span class="annottext">VarEnv TyCoVar
</span><a href="#local-6989586621680847523"><span class="hs-identifier hs-var">subst</span></a></span><span> </span><span class="annot"><span class="annottext">TyCoVar
</span><a href="#local-6989586621680847522"><span class="hs-identifier hs-var">tv</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-122"></span><span>        </span><span class="annot"><span class="annottext">Maybe TyCoVar
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span>  </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">(Type -&gt; Type) -&gt; TyCoVar -&gt; TyCoVar
</span><a href="GHC.Types.Var.html#updateVarType"><span class="hs-identifier hs-var">updateVarType</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">TidyEnv -&gt; Type -&gt; Type
</span><a href="GHC.Core.TyCo.Tidy.html#tidyType"><span class="hs-identifier hs-var">tidyType</span></a></span><span> </span><span class="annot"><span class="annottext">TidyEnv
</span><a href="#local-6989586621680847524"><span class="hs-identifier hs-var">env</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">TyCoVar
</span><a href="#local-6989586621680847522"><span class="hs-identifier hs-var">tv</span></a></span><span>
</span><span id="line-123"></span><span>        </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-type">Just</span></a></span><span> </span><span id="local-6989586621680847521"><span class="annot"><span class="annottext">TyCoVar
</span><a href="#local-6989586621680847521"><span class="hs-identifier hs-var">tv'</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">TyCoVar
</span><a href="#local-6989586621680847521"><span class="hs-identifier hs-var">tv'</span></a></span><span>
</span><span id="line-124"></span><span>
</span><span id="line-125"></span><span class="hs-comment">---------------</span><span>
</span><span id="line-126"></span><span class="annot"><a href="GHC.Core.TyCo.Tidy.html#tidyTypes"><span class="hs-identifier hs-type">tidyTypes</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Types.Var.Env.html#TidyEnv"><span class="hs-identifier hs-type">TidyEnv</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#Type"><span class="hs-identifier hs-type">Type</span></a></span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#Type"><span class="hs-identifier hs-type">Type</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-127"></span><span id="tidyTypes"><span class="annot"><span class="annottext">tidyTypes :: TidyEnv -&gt; [Type] -&gt; [Type]
</span><a href="GHC.Core.TyCo.Tidy.html#tidyTypes"><span class="hs-identifier hs-var hs-var">tidyTypes</span></a></span></span><span> </span><span id="local-6989586621680847520"><span class="annot"><span class="annottext">TidyEnv
</span><a href="#local-6989586621680847520"><span class="hs-identifier hs-var">env</span></a></span></span><span> </span><span id="local-6989586621680847519"><span class="annot"><span class="annottext">[Type]
</span><a href="#local-6989586621680847519"><span class="hs-identifier hs-var">tys</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(Type -&gt; Type) -&gt; [Type] -&gt; [Type]
forall a b. (a -&gt; b) -&gt; [a] -&gt; [b]
</span><a href="../../base/src/GHC.Base.html#map"><span class="hs-identifier hs-var">map</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">TidyEnv -&gt; Type -&gt; Type
</span><a href="GHC.Core.TyCo.Tidy.html#tidyType"><span class="hs-identifier hs-var">tidyType</span></a></span><span> </span><span class="annot"><span class="annottext">TidyEnv
</span><a href="#local-6989586621680847520"><span class="hs-identifier hs-var">env</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">[Type]
</span><a href="#local-6989586621680847519"><span class="hs-identifier hs-var">tys</span></a></span><span>
</span><span id="line-128"></span><span>
</span><span id="line-129"></span><span class="hs-comment">---------------</span><span>
</span><span id="line-130"></span><span class="annot"><a href="GHC.Core.TyCo.Tidy.html#tidyType"><span class="hs-identifier hs-type">tidyType</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Types.Var.Env.html#TidyEnv"><span class="hs-identifier hs-type">TidyEnv</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#Type"><span class="hs-identifier hs-type">Type</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#Type"><span class="hs-identifier hs-type">Type</span></a></span><span>
</span><span id="line-131"></span><span id="tidyType"><span class="annot"><span class="annottext">tidyType :: TidyEnv -&gt; Type -&gt; Type
</span><a href="GHC.Core.TyCo.Tidy.html#tidyType"><span class="hs-identifier hs-var hs-var">tidyType</span></a></span></span><span> </span><span class="annot"><span class="annottext">TidyEnv
</span><span class="hs-identifier">_</span></span><span>   </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#LitTy"><span class="hs-identifier hs-type">LitTy</span></a></span><span> </span><span id="local-6989586621680847517"><span class="annot"><span class="annottext">TyLit
</span><a href="#local-6989586621680847517"><span class="hs-identifier hs-var">n</span></a></span></span><span class="hs-special">)</span><span>             </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">TyLit -&gt; Type
</span><a href="GHC.Core.TyCo.Rep.html#LitTy"><span class="hs-identifier hs-var">LitTy</span></a></span><span> </span><span class="annot"><span class="annottext">TyLit
</span><a href="#local-6989586621680847517"><span class="hs-identifier hs-var">n</span></a></span><span>
</span><span id="line-132"></span><span class="annot"><a href="GHC.Core.TyCo.Tidy.html#tidyType"><span class="hs-identifier hs-var">tidyType</span></a></span><span> </span><span id="local-6989586621680847516"><span class="annot"><span class="annottext">TidyEnv
</span><a href="#local-6989586621680847516"><span class="hs-identifier hs-var">env</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#TyVarTy"><span class="hs-identifier hs-type">TyVarTy</span></a></span><span> </span><span id="local-6989586621680847514"><span class="annot"><span class="annottext">TyCoVar
</span><a href="#local-6989586621680847514"><span class="hs-identifier hs-var">tv</span></a></span></span><span class="hs-special">)</span><span>          </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">TyCoVar -&gt; Type
</span><a href="GHC.Core.TyCo.Rep.html#TyVarTy"><span class="hs-identifier hs-var">TyVarTy</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">TidyEnv -&gt; TyCoVar -&gt; TyCoVar
</span><a href="GHC.Core.TyCo.Tidy.html#tidyTyCoVarOcc"><span class="hs-identifier hs-var">tidyTyCoVarOcc</span></a></span><span> </span><span class="annot"><span class="annottext">TidyEnv
</span><a href="#local-6989586621680847516"><span class="hs-identifier hs-var">env</span></a></span><span> </span><span class="annot"><span class="annottext">TyCoVar
</span><a href="#local-6989586621680847514"><span class="hs-identifier hs-var">tv</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-133"></span><span class="annot"><a href="GHC.Core.TyCo.Tidy.html#tidyType"><span class="hs-identifier hs-var">tidyType</span></a></span><span> </span><span id="local-6989586621680847513"><span class="annot"><span class="annottext">TidyEnv
</span><a href="#local-6989586621680847513"><span class="hs-identifier hs-var">env</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#TyConApp"><span class="hs-identifier hs-type">TyConApp</span></a></span><span> </span><span id="local-6989586621680847511"><span class="annot"><span class="annottext">TyCon
</span><a href="#local-6989586621680847511"><span class="hs-identifier hs-var">tycon</span></a></span></span><span> </span><span id="local-6989586621680847510"><span class="annot"><span class="annottext">[Type]
</span><a href="#local-6989586621680847510"><span class="hs-identifier hs-var">tys</span></a></span></span><span class="hs-special">)</span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621680847509"><span class="annot"><span class="annottext">args :: [Type]
</span><a href="#local-6989586621680847509"><span class="hs-identifier hs-var hs-var">args</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">TidyEnv -&gt; [Type] -&gt; [Type]
</span><a href="GHC.Core.TyCo.Tidy.html#tidyTypes"><span class="hs-identifier hs-var">tidyTypes</span></a></span><span> </span><span class="annot"><span class="annottext">TidyEnv
</span><a href="#local-6989586621680847513"><span class="hs-identifier hs-var">env</span></a></span><span> </span><span class="annot"><span class="annottext">[Type]
</span><a href="#local-6989586621680847510"><span class="hs-identifier hs-var">tys</span></a></span><span>
</span><span id="line-134"></span><span>                                     </span><span class="hs-keyword">in</span><span> </span><span class="annot"><span class="annottext">[Type]
</span><a href="#local-6989586621680847509"><span class="hs-identifier hs-var">args</span></a></span><span> </span><span class="annot"><span class="annottext">[Type] -&gt; Type -&gt; Type
forall a b. [a] -&gt; b -&gt; b
</span><a href="GHC.Utils.Misc.html#seqList"><span class="hs-operator hs-var">`seqList`</span></a></span><span> </span><span class="annot"><span class="annottext">TyCon -&gt; [Type] -&gt; Type
</span><a href="GHC.Core.TyCo.Rep.html#TyConApp"><span class="hs-identifier hs-var">TyConApp</span></a></span><span> </span><span class="annot"><span class="annottext">TyCon
</span><a href="#local-6989586621680847511"><span class="hs-identifier hs-var">tycon</span></a></span><span> </span><span class="annot"><span class="annottext">[Type]
</span><a href="#local-6989586621680847509"><span class="hs-identifier hs-var">args</span></a></span><span>
</span><span id="line-135"></span><span class="annot"><a href="GHC.Core.TyCo.Tidy.html#tidyType"><span class="hs-identifier hs-var">tidyType</span></a></span><span> </span><span id="local-6989586621680847508"><span class="annot"><span class="annottext">TidyEnv
</span><a href="#local-6989586621680847508"><span class="hs-identifier hs-var">env</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#AppTy"><span class="hs-identifier hs-type">AppTy</span></a></span><span> </span><span id="local-6989586621680847506"><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621680847506"><span class="hs-identifier hs-var">fun</span></a></span></span><span> </span><span id="local-6989586621680847505"><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621680847505"><span class="hs-identifier hs-var">arg</span></a></span></span><span class="hs-special">)</span><span>       </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Type -&gt; Type -&gt; Type
</span><a href="GHC.Core.TyCo.Rep.html#AppTy"><span class="hs-identifier hs-var">AppTy</span></a></span><span> </span><span class="annot"><span class="annottext">(Type -&gt; Type -&gt; Type) -&gt; Type -&gt; Type -&gt; Type
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24%21"><span class="hs-operator hs-var">$!</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">TidyEnv -&gt; Type -&gt; Type
</span><a href="GHC.Core.TyCo.Tidy.html#tidyType"><span class="hs-identifier hs-var">tidyType</span></a></span><span> </span><span class="annot"><span class="annottext">TidyEnv
</span><a href="#local-6989586621680847508"><span class="hs-identifier hs-var">env</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621680847506"><span class="hs-identifier hs-var">fun</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">(Type -&gt; Type) -&gt; Type -&gt; Type
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24%21"><span class="hs-operator hs-var">$!</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">TidyEnv -&gt; Type -&gt; Type
</span><a href="GHC.Core.TyCo.Tidy.html#tidyType"><span class="hs-identifier hs-var">tidyType</span></a></span><span> </span><span class="annot"><span class="annottext">TidyEnv
</span><a href="#local-6989586621680847508"><span class="hs-identifier hs-var">env</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621680847505"><span class="hs-identifier hs-var">arg</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-136"></span><span class="annot"><a href="GHC.Core.TyCo.Tidy.html#tidyType"><span class="hs-identifier hs-var">tidyType</span></a></span><span> </span><span id="local-6989586621680847503"><span class="annot"><span class="annottext">TidyEnv
</span><a href="#local-6989586621680847503"><span class="hs-identifier hs-var">env</span></a></span></span><span> </span><span id="local-6989586621680847502"><span class="annot"><span class="annottext">ty :: Type
</span><a href="#local-6989586621680847502"><span class="hs-identifier hs-var">ty</span></a></span></span><span class="hs-glyph">@</span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#FunTy"><span class="hs-identifier hs-type">FunTy</span></a></span><span> </span><span class="annot"><span class="annottext">AnonArgFlag
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621680847500"><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621680847500"><span class="hs-identifier hs-var">w</span></a></span></span><span> </span><span id="local-6989586621680847499"><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621680847499"><span class="hs-identifier hs-var">arg</span></a></span></span><span> </span><span id="local-6989586621680847498"><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621680847498"><span class="hs-identifier hs-var">res</span></a></span></span><span class="hs-special">)</span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">let</span><span> </span><span class="hs-special">{</span><span> </span><span class="hs-glyph">!</span><span id="local-6989586621680847497"><span class="annot"><span class="annottext">w' :: Type
</span><a href="#local-6989586621680847497"><span class="hs-identifier hs-var hs-var">w'</span></a></span></span><span>   </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">TidyEnv -&gt; Type -&gt; Type
</span><a href="GHC.Core.TyCo.Tidy.html#tidyType"><span class="hs-identifier hs-var">tidyType</span></a></span><span> </span><span class="annot"><span class="annottext">TidyEnv
</span><a href="#local-6989586621680847503"><span class="hs-identifier hs-var">env</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621680847500"><span class="hs-identifier hs-var">w</span></a></span><span>
</span><span id="line-137"></span><span>                                           </span><span class="hs-special">;</span><span> </span><span class="hs-glyph">!</span><span id="local-6989586621680847496"><span class="annot"><span class="annottext">arg' :: Type
</span><a href="#local-6989586621680847496"><span class="hs-identifier hs-var hs-var">arg'</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">TidyEnv -&gt; Type -&gt; Type
</span><a href="GHC.Core.TyCo.Tidy.html#tidyType"><span class="hs-identifier hs-var">tidyType</span></a></span><span> </span><span class="annot"><span class="annottext">TidyEnv
</span><a href="#local-6989586621680847503"><span class="hs-identifier hs-var">env</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621680847499"><span class="hs-identifier hs-var">arg</span></a></span><span>
</span><span id="line-138"></span><span>                                           </span><span class="hs-special">;</span><span> </span><span class="hs-glyph">!</span><span id="local-6989586621680847495"><span class="annot"><span class="annottext">res' :: Type
</span><a href="#local-6989586621680847495"><span class="hs-identifier hs-var hs-var">res'</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">TidyEnv -&gt; Type -&gt; Type
</span><a href="GHC.Core.TyCo.Tidy.html#tidyType"><span class="hs-identifier hs-var">tidyType</span></a></span><span> </span><span class="annot"><span class="annottext">TidyEnv
</span><a href="#local-6989586621680847503"><span class="hs-identifier hs-var">env</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621680847498"><span class="hs-identifier hs-var">res</span></a></span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-139"></span><span>                                       </span><span class="hs-keyword">in</span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621680847502"><span class="hs-identifier hs-var">ty</span></a></span><span> </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">ft_mult :: Type
</span><a href="GHC.Core.TyCo.Rep.html#ft_mult"><span class="hs-identifier hs-var">ft_mult</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621680847497"><span class="hs-identifier hs-var">w'</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">ft_arg :: Type
</span><a href="GHC.Core.TyCo.Rep.html#ft_arg"><span class="hs-identifier hs-var">ft_arg</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621680847496"><span class="hs-identifier hs-var">arg'</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">ft_res :: Type
</span><a href="GHC.Core.TyCo.Rep.html#ft_res"><span class="hs-identifier hs-var">ft_res</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621680847495"><span class="hs-identifier hs-var">res'</span></a></span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-140"></span><span class="annot"><a href="GHC.Core.TyCo.Tidy.html#tidyType"><span class="hs-identifier hs-var">tidyType</span></a></span><span> </span><span id="local-6989586621680847491"><span class="annot"><span class="annottext">TidyEnv
</span><a href="#local-6989586621680847491"><span class="hs-identifier hs-var">env</span></a></span></span><span> </span><span class="hs-special">(</span><span id="local-6989586621680847490"><span class="annot"><span class="annottext">ty :: Type
</span><a href="#local-6989586621680847490"><span class="hs-identifier hs-var">ty</span></a></span></span><span class="hs-glyph">@</span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#ForAllTy"><span class="hs-identifier hs-type">ForAllTy</span></a></span><span class="hs-special">{</span><span class="hs-special">}</span><span class="hs-special">)</span><span class="hs-special">)</span><span>     </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[(TyCoVar, ArgFlag)] -&gt; Type -&gt; Type
</span><a href="GHC.Core.TyCo.Tidy.html#mkForAllTys%27"><span class="hs-identifier hs-var">mkForAllTys'</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[TyCoVar] -&gt; [ArgFlag] -&gt; [(TyCoVar, ArgFlag)]
forall a b. [a] -&gt; [b] -&gt; [(a, b)]
</span><a href="../../base/src/GHC.List.html#zip"><span class="hs-identifier hs-var">zip</span></a></span><span> </span><span class="annot"><span class="annottext">[TyCoVar]
</span><a href="#local-6989586621680847487"><span class="hs-identifier hs-var">tvs'</span></a></span><span> </span><span class="annot"><span class="annottext">[ArgFlag]
</span><a href="#local-6989586621680847486"><span class="hs-identifier hs-var">vis</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">(Type -&gt; Type) -&gt; Type -&gt; Type
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24%21"><span class="hs-operator hs-var">$!</span></a></span><span> </span><span class="annot"><span class="annottext">TidyEnv -&gt; Type -&gt; Type
</span><a href="GHC.Core.TyCo.Tidy.html#tidyType"><span class="hs-identifier hs-var">tidyType</span></a></span><span> </span><span class="annot"><span class="annottext">TidyEnv
</span><a href="#local-6989586621680847485"><span class="hs-identifier hs-var">env'</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621680847484"><span class="hs-identifier hs-var">body_ty</span></a></span><span>
</span><span id="line-141"></span><span>  </span><span class="hs-keyword">where</span><span>
</span><span id="line-142"></span><span>    </span><span class="hs-special">(</span><span id="local-6989586621680847483"><span class="annot"><span class="annottext">[TyCoVar]
</span><a href="#local-6989586621680847483"><span class="hs-identifier hs-var">tvs</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621680847486"><span class="annot"><span class="annottext">[ArgFlag]
</span><a href="#local-6989586621680847486"><span class="hs-identifier hs-var">vis</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621680847484"><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621680847484"><span class="hs-identifier hs-var">body_ty</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Type -&gt; ([TyCoVar], [ArgFlag], Type)
</span><a href="GHC.Core.TyCo.Tidy.html#splitForAllTys%27"><span class="hs-identifier hs-var">splitForAllTys'</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621680847490"><span class="hs-identifier hs-var">ty</span></a></span><span>
</span><span id="line-143"></span><span>    </span><span class="hs-special">(</span><span id="local-6989586621680847485"><span class="annot"><span class="annottext">TidyEnv
</span><a href="#local-6989586621680847485"><span class="hs-identifier hs-var">env'</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621680847487"><span class="annot"><span class="annottext">[TyCoVar]
</span><a href="#local-6989586621680847487"><span class="hs-identifier hs-var">tvs'</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">TidyEnv -&gt; [TyCoVar] -&gt; (TidyEnv, [TyCoVar])
</span><a href="GHC.Core.TyCo.Tidy.html#tidyVarBndrs"><span class="hs-identifier hs-var">tidyVarBndrs</span></a></span><span> </span><span class="annot"><span class="annottext">TidyEnv
</span><a href="#local-6989586621680847491"><span class="hs-identifier hs-var">env</span></a></span><span> </span><span class="annot"><span class="annottext">[TyCoVar]
</span><a href="#local-6989586621680847483"><span class="hs-identifier hs-var">tvs</span></a></span><span>
</span><span id="line-144"></span><span class="annot"><a href="GHC.Core.TyCo.Tidy.html#tidyType"><span class="hs-identifier hs-var">tidyType</span></a></span><span> </span><span id="local-6989586621680847481"><span class="annot"><span class="annottext">TidyEnv
</span><a href="#local-6989586621680847481"><span class="hs-identifier hs-var">env</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#CastTy"><span class="hs-identifier hs-type">CastTy</span></a></span><span> </span><span id="local-6989586621680847479"><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621680847479"><span class="hs-identifier hs-var">ty</span></a></span></span><span> </span><span id="local-6989586621680847478"><span class="annot"><span class="annottext">KindCoercion
</span><a href="#local-6989586621680847478"><span class="hs-identifier hs-var">co</span></a></span></span><span class="hs-special">)</span><span>       </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Type -&gt; KindCoercion -&gt; Type
</span><a href="GHC.Core.TyCo.Rep.html#CastTy"><span class="hs-identifier hs-var">CastTy</span></a></span><span> </span><span class="annot"><span class="annottext">(Type -&gt; KindCoercion -&gt; Type) -&gt; Type -&gt; KindCoercion -&gt; Type
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24%21"><span class="hs-operator hs-var">$!</span></a></span><span> </span><span class="annot"><span class="annottext">TidyEnv -&gt; Type -&gt; Type
</span><a href="GHC.Core.TyCo.Tidy.html#tidyType"><span class="hs-identifier hs-var">tidyType</span></a></span><span> </span><span class="annot"><span class="annottext">TidyEnv
</span><a href="#local-6989586621680847481"><span class="hs-identifier hs-var">env</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621680847479"><span class="hs-identifier hs-var">ty</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">(KindCoercion -&gt; Type) -&gt; KindCoercion -&gt; Type
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24%21"><span class="hs-operator hs-var">$!</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">TidyEnv -&gt; KindCoercion -&gt; KindCoercion
</span><a href="GHC.Core.TyCo.Tidy.html#tidyCo"><span class="hs-identifier hs-var">tidyCo</span></a></span><span> </span><span class="annot"><span class="annottext">TidyEnv
</span><a href="#local-6989586621680847481"><span class="hs-identifier hs-var">env</span></a></span><span> </span><span class="annot"><span class="annottext">KindCoercion
</span><a href="#local-6989586621680847478"><span class="hs-identifier hs-var">co</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-145"></span><span class="annot"><a href="GHC.Core.TyCo.Tidy.html#tidyType"><span class="hs-identifier hs-var">tidyType</span></a></span><span> </span><span id="local-6989586621680847477"><span class="annot"><span class="annottext">TidyEnv
</span><a href="#local-6989586621680847477"><span class="hs-identifier hs-var">env</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#CoercionTy"><span class="hs-identifier hs-type">CoercionTy</span></a></span><span> </span><span id="local-6989586621680847475"><span class="annot"><span class="annottext">KindCoercion
</span><a href="#local-6989586621680847475"><span class="hs-identifier hs-var">co</span></a></span></span><span class="hs-special">)</span><span>      </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">KindCoercion -&gt; Type
</span><a href="GHC.Core.TyCo.Rep.html#CoercionTy"><span class="hs-identifier hs-var">CoercionTy</span></a></span><span> </span><span class="annot"><span class="annottext">(KindCoercion -&gt; Type) -&gt; KindCoercion -&gt; Type
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24%21"><span class="hs-operator hs-var">$!</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">TidyEnv -&gt; KindCoercion -&gt; KindCoercion
</span><a href="GHC.Core.TyCo.Tidy.html#tidyCo"><span class="hs-identifier hs-var">tidyCo</span></a></span><span> </span><span class="annot"><span class="annottext">TidyEnv
</span><a href="#local-6989586621680847477"><span class="hs-identifier hs-var">env</span></a></span><span> </span><span class="annot"><span class="annottext">KindCoercion
</span><a href="#local-6989586621680847475"><span class="hs-identifier hs-var">co</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-146"></span><span>
</span><span id="line-147"></span><span>
</span><span id="line-148"></span><span class="hs-comment">-- The following two functions differ from mkForAllTys and splitForAllTys in that</span><span>
</span><span id="line-149"></span><span class="hs-comment">-- they expect/preserve the ArgFlag argument. These belong to &quot;GHC.Core.Type&quot;, but</span><span>
</span><span id="line-150"></span><span class="hs-comment">-- how should they be named?</span><span>
</span><span id="line-151"></span><span class="annot"><a href="GHC.Core.TyCo.Tidy.html#mkForAllTys%27"><span class="hs-identifier hs-type">mkForAllTys'</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">[</span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.Var.html#TyCoVar"><span class="hs-identifier hs-type">TyCoVar</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Types.Var.html#ArgFlag"><span class="hs-identifier hs-type">ArgFlag</span></a></span><span class="hs-special">)</span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#Type"><span class="hs-identifier hs-type">Type</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#Type"><span class="hs-identifier hs-type">Type</span></a></span><span>
</span><span id="line-152"></span><span id="mkForAllTys%27"><span class="annot"><span class="annottext">mkForAllTys' :: [(TyCoVar, ArgFlag)] -&gt; Type -&gt; Type
</span><a href="GHC.Core.TyCo.Tidy.html#mkForAllTys%27"><span class="hs-identifier hs-var hs-var">mkForAllTys'</span></a></span></span><span> </span><span id="local-6989586621680847474"><span class="annot"><span class="annottext">[(TyCoVar, ArgFlag)]
</span><a href="#local-6989586621680847474"><span class="hs-identifier hs-var">tvvs</span></a></span></span><span> </span><span id="local-6989586621680847473"><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621680847473"><span class="hs-identifier hs-var">ty</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">((TyCoVar, ArgFlag) -&gt; Type -&gt; Type)
-&gt; Type -&gt; [(TyCoVar, ArgFlag)] -&gt; Type
forall (t :: * -&gt; *) a b.
Foldable t =&gt;
(a -&gt; b -&gt; b) -&gt; b -&gt; t a -&gt; b
</span><a href="../../base/src/Data.Foldable.html#foldr"><span class="hs-identifier hs-var">foldr</span></a></span><span> </span><span class="annot"><span class="annottext">(TyCoVar, ArgFlag) -&gt; Type -&gt; Type
</span><a href="#local-6989586621680847471"><span class="hs-identifier hs-var">strictMkForAllTy</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621680847473"><span class="hs-identifier hs-var">ty</span></a></span><span> </span><span class="annot"><span class="annottext">[(TyCoVar, ArgFlag)]
</span><a href="#local-6989586621680847474"><span class="hs-identifier hs-var">tvvs</span></a></span><span>
</span><span id="line-153"></span><span>  </span><span class="hs-keyword">where</span><span>
</span><span id="line-154"></span><span>    </span><span id="local-6989586621680847471"><span class="annot"><span class="annottext">strictMkForAllTy :: (TyCoVar, ArgFlag) -&gt; Type -&gt; Type
</span><a href="#local-6989586621680847471"><span class="hs-identifier hs-var hs-var">strictMkForAllTy</span></a></span></span><span> </span><span class="hs-special">(</span><span id="local-6989586621680847470"><span class="annot"><span class="annottext">TyCoVar
</span><a href="#local-6989586621680847470"><span class="hs-identifier hs-var">tv</span></a></span></span><span class="hs-special">,</span><span id="local-6989586621680847469"><span class="annot"><span class="annottext">ArgFlag
</span><a href="#local-6989586621680847469"><span class="hs-identifier hs-var">vis</span></a></span></span><span class="hs-special">)</span><span> </span><span id="local-6989586621680847468"><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621680847468"><span class="hs-identifier hs-var">ty</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">TyCoVarBinder -&gt; Type -&gt; Type
</span><a href="GHC.Core.TyCo.Rep.html#ForAllTy"><span class="hs-identifier hs-var">ForAllTy</span></a></span><span> </span><span class="annot"><span class="annottext">(TyCoVarBinder -&gt; Type -&gt; Type) -&gt; TyCoVarBinder -&gt; Type -&gt; Type
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24%21"><span class="hs-operator hs-var">$!</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">(</span><span class="annot"><span class="annottext">TyCoVar -&gt; ArgFlag -&gt; TyCoVarBinder
forall var argf. var -&gt; argf -&gt; VarBndr var argf
</span><a href="GHC.Types.Var.html#Bndr"><span class="hs-identifier hs-var">Bndr</span></a></span><span> </span><span class="annot"><span class="annottext">(TyCoVar -&gt; ArgFlag -&gt; TyCoVarBinder)
-&gt; TyCoVar -&gt; ArgFlag -&gt; TyCoVarBinder
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24%21"><span class="hs-operator hs-var">$!</span></a></span><span> </span><span class="annot"><span class="annottext">TyCoVar
</span><a href="#local-6989586621680847470"><span class="hs-identifier hs-var">tv</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">(ArgFlag -&gt; TyCoVarBinder) -&gt; ArgFlag -&gt; TyCoVarBinder
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24%21"><span class="hs-operator hs-var">$!</span></a></span><span> </span><span class="annot"><span class="annottext">ArgFlag
</span><a href="#local-6989586621680847469"><span class="hs-identifier hs-var">vis</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">(Type -&gt; Type) -&gt; Type -&gt; Type
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24%21"><span class="hs-operator hs-var">$!</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621680847468"><span class="hs-identifier hs-var">ty</span></a></span><span>
</span><span id="line-155"></span><span>
</span><span id="line-156"></span><span class="annot"><a href="GHC.Core.TyCo.Tidy.html#splitForAllTys%27"><span class="hs-identifier hs-type">splitForAllTys'</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#Type"><span class="hs-identifier hs-type">Type</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="hs-special">[</span><span class="annot"><a href="GHC.Types.Var.html#TyCoVar"><span class="hs-identifier hs-type">TyCoVar</span></a></span><span class="hs-special">]</span><span class="hs-special">,</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Types.Var.html#ArgFlag"><span class="hs-identifier hs-type">ArgFlag</span></a></span><span class="hs-special">]</span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#Type"><span class="hs-identifier hs-type">Type</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-157"></span><span id="splitForAllTys%27"><span class="annot"><span class="annottext">splitForAllTys' :: Type -&gt; ([TyCoVar], [ArgFlag], Type)
</span><a href="GHC.Core.TyCo.Tidy.html#splitForAllTys%27"><span class="hs-identifier hs-var hs-var">splitForAllTys'</span></a></span></span><span> </span><span id="local-6989586621680847467"><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621680847467"><span class="hs-identifier hs-var">ty</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Type -&gt; [TyCoVar] -&gt; [ArgFlag] -&gt; ([TyCoVar], [ArgFlag], Type)
</span><a href="#local-6989586621680847466"><span class="hs-identifier hs-var">go</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621680847467"><span class="hs-identifier hs-var">ty</span></a></span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span>
</span><span id="line-158"></span><span>  </span><span class="hs-keyword">where</span><span>
</span><span id="line-159"></span><span>    </span><span id="local-6989586621680847466"><span class="annot"><span class="annottext">go :: Type -&gt; [TyCoVar] -&gt; [ArgFlag] -&gt; ([TyCoVar], [ArgFlag], Type)
</span><a href="#local-6989586621680847466"><span class="hs-identifier hs-var hs-var">go</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#ForAllTy"><span class="hs-identifier hs-type">ForAllTy</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.Var.html#Bndr"><span class="hs-identifier hs-type">Bndr</span></a></span><span> </span><span id="local-6989586621680847465"><span class="annot"><span class="annottext">TyCoVar
</span><a href="#local-6989586621680847465"><span class="hs-identifier hs-var">tv</span></a></span></span><span> </span><span id="local-6989586621680847464"><span class="annot"><span class="annottext">ArgFlag
</span><a href="#local-6989586621680847464"><span class="hs-identifier hs-var">vis</span></a></span></span><span class="hs-special">)</span><span> </span><span id="local-6989586621680847463"><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621680847463"><span class="hs-identifier hs-var">ty</span></a></span></span><span class="hs-special">)</span><span> </span><span id="local-6989586621680847462"><span class="annot"><span class="annottext">[TyCoVar]
</span><a href="#local-6989586621680847462"><span class="hs-identifier hs-var">tvs</span></a></span></span><span> </span><span id="local-6989586621680847461"><span class="annot"><span class="annottext">[ArgFlag]
</span><a href="#local-6989586621680847461"><span class="hs-identifier hs-var">viss</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Type -&gt; [TyCoVar] -&gt; [ArgFlag] -&gt; ([TyCoVar], [ArgFlag], Type)
</span><a href="#local-6989586621680847466"><span class="hs-identifier hs-var">go</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621680847463"><span class="hs-identifier hs-var">ty</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">TyCoVar
</span><a href="#local-6989586621680847465"><span class="hs-identifier hs-var">tv</span></a></span><span class="annot"><span class="annottext">TyCoVar -&gt; [TyCoVar] -&gt; [TyCoVar]
forall a. a -&gt; [a] -&gt; [a]
</span><span class="hs-glyph hs-var">:</span></span><span class="annot"><span class="annottext">[TyCoVar]
</span><a href="#local-6989586621680847462"><span class="hs-identifier hs-var">tvs</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">ArgFlag
</span><a href="#local-6989586621680847464"><span class="hs-identifier hs-var">vis</span></a></span><span class="annot"><span class="annottext">ArgFlag -&gt; [ArgFlag] -&gt; [ArgFlag]
forall a. a -&gt; [a] -&gt; [a]
</span><span class="hs-glyph hs-var">:</span></span><span class="annot"><span class="annottext">[ArgFlag]
</span><a href="#local-6989586621680847461"><span class="hs-identifier hs-var">viss</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-160"></span><span>    </span><span class="annot"><a href="#local-6989586621680847466"><span class="hs-identifier hs-var">go</span></a></span><span> </span><span id="local-6989586621680847460"><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621680847460"><span class="hs-identifier hs-var">ty</span></a></span></span><span>                          </span><span id="local-6989586621680847459"><span class="annot"><span class="annottext">[TyCoVar]
</span><a href="#local-6989586621680847459"><span class="hs-identifier hs-var">tvs</span></a></span></span><span> </span><span id="local-6989586621680847458"><span class="annot"><span class="annottext">[ArgFlag]
</span><a href="#local-6989586621680847458"><span class="hs-identifier hs-var">viss</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[TyCoVar] -&gt; [TyCoVar]
forall a. [a] -&gt; [a]
</span><a href="../../base/src/GHC.List.html#reverse"><span class="hs-identifier hs-var">reverse</span></a></span><span> </span><span class="annot"><span class="annottext">[TyCoVar]
</span><a href="#local-6989586621680847459"><span class="hs-identifier hs-var">tvs</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">[ArgFlag] -&gt; [ArgFlag]
forall a. [a] -&gt; [a]
</span><a href="../../base/src/GHC.List.html#reverse"><span class="hs-identifier hs-var">reverse</span></a></span><span> </span><span class="annot"><span class="annottext">[ArgFlag]
</span><a href="#local-6989586621680847458"><span class="hs-identifier hs-var">viss</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621680847460"><span class="hs-identifier hs-var">ty</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-161"></span><span>
</span><span id="line-162"></span><span>
</span><span id="line-163"></span><span class="hs-comment">---------------</span><span>
</span><span id="line-164"></span><span class="hs-comment">-- | Grabs the free type variables, tidies them</span><span>
</span><span id="line-165"></span><span class="hs-comment">-- and then uses 'tidyType' to work over the type itself</span><span>
</span><span id="line-166"></span><span class="annot"><a href="GHC.Core.TyCo.Tidy.html#tidyOpenTypes"><span class="hs-identifier hs-type">tidyOpenTypes</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Types.Var.Env.html#TidyEnv"><span class="hs-identifier hs-type">TidyEnv</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#Type"><span class="hs-identifier hs-type">Type</span></a></span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.Var.Env.html#TidyEnv"><span class="hs-identifier hs-type">TidyEnv</span></a></span><span class="hs-special">,</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#Type"><span class="hs-identifier hs-type">Type</span></a></span><span class="hs-special">]</span><span class="hs-special">)</span><span>
</span><span id="line-167"></span><span id="tidyOpenTypes"><span class="annot"><span class="annottext">tidyOpenTypes :: TidyEnv -&gt; [Type] -&gt; (TidyEnv, [Type])
</span><a href="GHC.Core.TyCo.Tidy.html#tidyOpenTypes"><span class="hs-identifier hs-var hs-var">tidyOpenTypes</span></a></span></span><span> </span><span id="local-6989586621680847456"><span class="annot"><span class="annottext">TidyEnv
</span><a href="#local-6989586621680847456"><span class="hs-identifier hs-var">env</span></a></span></span><span> </span><span id="local-6989586621680847455"><span class="annot"><span class="annottext">[Type]
</span><a href="#local-6989586621680847455"><span class="hs-identifier hs-var">tys</span></a></span></span><span>
</span><span id="line-168"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">TidyEnv
</span><a href="#local-6989586621680847454"><span class="hs-identifier hs-var">env'</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">TidyEnv -&gt; [Type] -&gt; [Type]
</span><a href="GHC.Core.TyCo.Tidy.html#tidyTypes"><span class="hs-identifier hs-var">tidyTypes</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">TidyOccEnv
</span><a href="#local-6989586621680847453"><span class="hs-identifier hs-var">trimmed_occ_env</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">VarEnv TyCoVar
</span><a href="#local-6989586621680847452"><span class="hs-identifier hs-var">var_env</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">[Type]
</span><a href="#local-6989586621680847455"><span class="hs-identifier hs-var">tys</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-169"></span><span>  </span><span class="hs-keyword">where</span><span>
</span><span id="line-170"></span><span>    </span><span class="hs-special">(</span><span id="local-6989586621680847454"><span class="annot"><span class="annottext">env' :: TidyEnv
</span><a href="#local-6989586621680847454"><span class="hs-identifier hs-var">env'</span></a></span></span><span class="hs-glyph">@</span><span class="hs-special">(</span><span class="annot"><span class="annottext">TidyOccEnv
</span><span class="hs-identifier">_</span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621680847452"><span class="annot"><span class="annottext">VarEnv TyCoVar
</span><a href="#local-6989586621680847452"><span class="hs-identifier hs-var">var_env</span></a></span></span><span class="hs-special">)</span><span class="hs-special">,</span><span> </span><span id="local-6989586621680847451"><span class="annot"><span class="annottext">[TyCoVar]
</span><a href="#local-6989586621680847451"><span class="hs-identifier hs-var">tvs'</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">TidyEnv -&gt; [TyCoVar] -&gt; (TidyEnv, [TyCoVar])
</span><a href="GHC.Core.TyCo.Tidy.html#tidyOpenTyCoVars"><span class="hs-identifier hs-var">tidyOpenTyCoVars</span></a></span><span> </span><span class="annot"><span class="annottext">TidyEnv
</span><a href="#local-6989586621680847456"><span class="hs-identifier hs-var">env</span></a></span><span> </span><span class="annot"><span class="annottext">([TyCoVar] -&gt; (TidyEnv, [TyCoVar]))
-&gt; [TyCoVar] -&gt; (TidyEnv, [TyCoVar])
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span>
</span><span id="line-171"></span><span>                                </span><span class="annot"><span class="annottext">[Type] -&gt; [TyCoVar]
</span><a href="GHC.Core.TyCo.FVs.html#tyCoVarsOfTypesWellScoped"><span class="hs-identifier hs-var">tyCoVarsOfTypesWellScoped</span></a></span><span> </span><span class="annot"><span class="annottext">[Type]
</span><a href="#local-6989586621680847455"><span class="hs-identifier hs-var">tys</span></a></span><span>
</span><span id="line-172"></span><span>    </span><span id="local-6989586621680847453"><span class="annot"><span class="annottext">trimmed_occ_env :: TidyOccEnv
</span><a href="#local-6989586621680847453"><span class="hs-identifier hs-var hs-var">trimmed_occ_env</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[OccName] -&gt; TidyOccEnv
</span><a href="GHC.Types.Name.Occurrence.html#initTidyOccEnv"><span class="hs-identifier hs-var">initTidyOccEnv</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">(TyCoVar -&gt; OccName) -&gt; [TyCoVar] -&gt; [OccName]
forall a b. (a -&gt; b) -&gt; [a] -&gt; [b]
</span><a href="../../base/src/GHC.Base.html#map"><span class="hs-identifier hs-var">map</span></a></span><span> </span><span class="annot"><span class="annottext">TyCoVar -&gt; OccName
forall a. NamedThing a =&gt; a -&gt; OccName
</span><a href="GHC.Types.Name.html#getOccName"><span class="hs-identifier hs-var">getOccName</span></a></span><span> </span><span class="annot"><span class="annottext">[TyCoVar]
</span><a href="#local-6989586621680847451"><span class="hs-identifier hs-var">tvs'</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-173"></span><span>      </span><span class="hs-comment">-- The idea here was that we restrict the new TidyEnv to the</span><span>
</span><span id="line-174"></span><span>      </span><span class="hs-comment">-- _free_ vars of the types, so that we don't gratuitously rename</span><span>
</span><span id="line-175"></span><span>      </span><span class="hs-comment">-- the _bound_ variables of the types.</span><span>
</span><span id="line-176"></span><span>
</span><span id="line-177"></span><span class="hs-comment">---------------</span><span>
</span><span id="line-178"></span><span class="annot"><a href="GHC.Core.TyCo.Tidy.html#tidyOpenType"><span class="hs-identifier hs-type">tidyOpenType</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Types.Var.Env.html#TidyEnv"><span class="hs-identifier hs-type">TidyEnv</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#Type"><span class="hs-identifier hs-type">Type</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.Var.Env.html#TidyEnv"><span class="hs-identifier hs-type">TidyEnv</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#Type"><span class="hs-identifier hs-type">Type</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-179"></span><span id="tidyOpenType"><span class="annot"><span class="annottext">tidyOpenType :: TidyEnv -&gt; Type -&gt; (TidyEnv, Type)
</span><a href="GHC.Core.TyCo.Tidy.html#tidyOpenType"><span class="hs-identifier hs-var hs-var">tidyOpenType</span></a></span></span><span> </span><span id="local-6989586621680847447"><span class="annot"><span class="annottext">TidyEnv
</span><a href="#local-6989586621680847447"><span class="hs-identifier hs-var">env</span></a></span></span><span> </span><span id="local-6989586621680847446"><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621680847446"><span class="hs-identifier hs-var">ty</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">let</span><span> </span><span class="hs-special">(</span><span id="local-6989586621680847445"><span class="annot"><span class="annottext">TidyEnv
</span><a href="#local-6989586621680847445"><span class="hs-identifier hs-var">env'</span></a></span></span><span class="hs-special">,</span><span> </span><span class="hs-special">[</span><span id="local-6989586621680847444"><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621680847444"><span class="hs-identifier hs-var">ty'</span></a></span></span><span class="hs-special">]</span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">TidyEnv -&gt; [Type] -&gt; (TidyEnv, [Type])
</span><a href="GHC.Core.TyCo.Tidy.html#tidyOpenTypes"><span class="hs-identifier hs-var">tidyOpenTypes</span></a></span><span> </span><span class="annot"><span class="annottext">TidyEnv
</span><a href="#local-6989586621680847447"><span class="hs-identifier hs-var">env</span></a></span><span> </span><span class="hs-special">[</span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621680847446"><span class="hs-identifier hs-var">ty</span></a></span><span class="hs-special">]</span><span> </span><span class="hs-keyword">in</span><span>
</span><span id="line-180"></span><span>                      </span><span class="hs-special">(</span><span class="annot"><span class="annottext">TidyEnv
</span><a href="#local-6989586621680847445"><span class="hs-identifier hs-var">env'</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621680847444"><span class="hs-identifier hs-var">ty'</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-181"></span><span>
</span><span id="line-182"></span><span class="hs-comment">---------------</span><span>
</span><span id="line-183"></span><span class="hs-comment">-- | Calls 'tidyType' on a top-level type (i.e. with an empty tidying environment)</span><span>
</span><span id="line-184"></span><span class="annot"><a href="GHC.Core.TyCo.Tidy.html#tidyTopType"><span class="hs-identifier hs-type">tidyTopType</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#Type"><span class="hs-identifier hs-type">Type</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#Type"><span class="hs-identifier hs-type">Type</span></a></span><span>
</span><span id="line-185"></span><span id="tidyTopType"><span class="annot"><span class="annottext">tidyTopType :: Type -&gt; Type
</span><a href="GHC.Core.TyCo.Tidy.html#tidyTopType"><span class="hs-identifier hs-var hs-var">tidyTopType</span></a></span></span><span> </span><span id="local-6989586621680847443"><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621680847443"><span class="hs-identifier hs-var">ty</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">TidyEnv -&gt; Type -&gt; Type
</span><a href="GHC.Core.TyCo.Tidy.html#tidyType"><span class="hs-identifier hs-var">tidyType</span></a></span><span> </span><span class="annot"><span class="annottext">TidyEnv
</span><a href="GHC.Types.Var.Env.html#emptyTidyEnv"><span class="hs-identifier hs-var">emptyTidyEnv</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621680847443"><span class="hs-identifier hs-var">ty</span></a></span><span>
</span><span id="line-186"></span><span>
</span><span id="line-187"></span><span class="hs-comment">---------------</span><span>
</span><span id="line-188"></span><span class="annot"><a href="GHC.Core.TyCo.Tidy.html#tidyOpenKind"><span class="hs-identifier hs-type">tidyOpenKind</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Types.Var.Env.html#TidyEnv"><span class="hs-identifier hs-type">TidyEnv</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#Kind"><span class="hs-identifier hs-type">Kind</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.Var.Env.html#TidyEnv"><span class="hs-identifier hs-type">TidyEnv</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#Kind"><span class="hs-identifier hs-type">Kind</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-189"></span><span id="tidyOpenKind"><span class="annot"><span class="annottext">tidyOpenKind :: TidyEnv -&gt; Type -&gt; (TidyEnv, Type)
</span><a href="GHC.Core.TyCo.Tidy.html#tidyOpenKind"><span class="hs-identifier hs-var hs-var">tidyOpenKind</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">TidyEnv -&gt; Type -&gt; (TidyEnv, Type)
</span><a href="GHC.Core.TyCo.Tidy.html#tidyOpenType"><span class="hs-identifier hs-var">tidyOpenType</span></a></span><span>
</span><span id="line-190"></span><span>
</span><span id="line-191"></span><span class="annot"><a href="GHC.Core.TyCo.Tidy.html#tidyKind"><span class="hs-identifier hs-type">tidyKind</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Types.Var.Env.html#TidyEnv"><span class="hs-identifier hs-type">TidyEnv</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#Kind"><span class="hs-identifier hs-type">Kind</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#Kind"><span class="hs-identifier hs-type">Kind</span></a></span><span>
</span><span id="line-192"></span><span id="tidyKind"><span class="annot"><span class="annottext">tidyKind :: TidyEnv -&gt; Type -&gt; Type
</span><a href="GHC.Core.TyCo.Tidy.html#tidyKind"><span class="hs-identifier hs-var hs-var">tidyKind</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">TidyEnv -&gt; Type -&gt; Type
</span><a href="GHC.Core.TyCo.Tidy.html#tidyType"><span class="hs-identifier hs-var">tidyType</span></a></span><span>
</span><span id="line-193"></span><span>
</span><span id="line-194"></span><span class="hs-comment">----------------</span><span>
</span><span id="line-195"></span><span class="annot"><a href="GHC.Core.TyCo.Tidy.html#tidyCo"><span class="hs-identifier hs-type">tidyCo</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Types.Var.Env.html#TidyEnv"><span class="hs-identifier hs-type">TidyEnv</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#Coercion"><span class="hs-identifier hs-type">Coercion</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#Coercion"><span class="hs-identifier hs-type">Coercion</span></a></span><span>
</span><span id="line-196"></span><span id="tidyCo"><span class="annot"><span class="annottext">tidyCo :: TidyEnv -&gt; KindCoercion -&gt; KindCoercion
</span><a href="GHC.Core.TyCo.Tidy.html#tidyCo"><span class="hs-identifier hs-var hs-var">tidyCo</span></a></span></span><span> </span><span id="local-6989586621680847439"><span class="annot"><span class="annottext">env :: TidyEnv
</span><a href="#local-6989586621680847439"><span class="hs-identifier hs-var">env</span></a></span></span><span class="hs-glyph">@</span><span class="hs-special">(</span><span class="annot"><span class="annottext">TidyOccEnv
</span><span class="hs-identifier">_</span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621680847438"><span class="annot"><span class="annottext">VarEnv TyCoVar
</span><a href="#local-6989586621680847438"><span class="hs-identifier hs-var">subst</span></a></span></span><span class="hs-special">)</span><span> </span><span id="local-6989586621680847437"><span class="annot"><span class="annottext">KindCoercion
</span><a href="#local-6989586621680847437"><span class="hs-identifier hs-var">co</span></a></span></span><span>
</span><span id="line-197"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">KindCoercion -&gt; KindCoercion
</span><a href="#local-6989586621680847436"><span class="hs-identifier hs-var">go</span></a></span><span> </span><span class="annot"><span class="annottext">KindCoercion
</span><a href="#local-6989586621680847437"><span class="hs-identifier hs-var">co</span></a></span><span>
</span><span id="line-198"></span><span>  </span><span class="hs-keyword">where</span><span>
</span><span id="line-199"></span><span>    </span><span id="local-6989586621680847435"><span class="annot"><span class="annottext">go_mco :: MCoercion -&gt; MCoercion
</span><a href="#local-6989586621680847435"><span class="hs-identifier hs-var hs-var">go_mco</span></a></span></span><span> </span><span class="annot"><span class="annottext">MCoercion
</span><a href="GHC.Core.TyCo.Rep.html#MRefl"><span class="hs-identifier hs-var">MRefl</span></a></span><span>    </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">MCoercion
</span><a href="GHC.Core.TyCo.Rep.html#MRefl"><span class="hs-identifier hs-var">MRefl</span></a></span><span>
</span><span id="line-200"></span><span>    </span><span class="annot"><a href="#local-6989586621680847435"><span class="hs-identifier hs-var">go_mco</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#MCo"><span class="hs-identifier hs-type">MCo</span></a></span><span> </span><span id="local-6989586621680847432"><span class="annot"><span class="annottext">KindCoercion
</span><a href="#local-6989586621680847432"><span class="hs-identifier hs-var">co</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">KindCoercion -&gt; MCoercion
</span><a href="GHC.Core.TyCo.Rep.html#MCo"><span class="hs-identifier hs-var">MCo</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">KindCoercion -&gt; KindCoercion
</span><a href="#local-6989586621680847436"><span class="hs-identifier hs-var">go</span></a></span><span> </span><span class="annot"><span class="annottext">KindCoercion
</span><a href="#local-6989586621680847432"><span class="hs-identifier hs-var">co</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-201"></span><span>
</span><span id="line-202"></span><span>    </span><span id="local-6989586621680847436"><span class="annot"><span class="annottext">go :: KindCoercion -&gt; KindCoercion
</span><a href="#local-6989586621680847436"><span class="hs-identifier hs-var hs-var">go</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#Refl"><span class="hs-identifier hs-type">Refl</span></a></span><span> </span><span id="local-6989586621680847430"><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621680847430"><span class="hs-identifier hs-var">ty</span></a></span></span><span class="hs-special">)</span><span>             </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Type -&gt; KindCoercion
</span><a href="GHC.Core.TyCo.Rep.html#Refl"><span class="hs-identifier hs-var">Refl</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">TidyEnv -&gt; Type -&gt; Type
</span><a href="GHC.Core.TyCo.Tidy.html#tidyType"><span class="hs-identifier hs-var">tidyType</span></a></span><span> </span><span class="annot"><span class="annottext">TidyEnv
</span><a href="#local-6989586621680847439"><span class="hs-identifier hs-var">env</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621680847430"><span class="hs-identifier hs-var">ty</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-203"></span><span>    </span><span class="annot"><a href="#local-6989586621680847436"><span class="hs-identifier hs-var">go</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#GRefl"><span class="hs-identifier hs-type">GRefl</span></a></span><span> </span><span id="local-6989586621680847428"><span class="annot"><span class="annottext">Role
</span><a href="#local-6989586621680847428"><span class="hs-identifier hs-var">r</span></a></span></span><span> </span><span id="local-6989586621680847427"><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621680847427"><span class="hs-identifier hs-var">ty</span></a></span></span><span> </span><span id="local-6989586621680847426"><span class="annot"><span class="annottext">MCoercion
</span><a href="#local-6989586621680847426"><span class="hs-identifier hs-var">mco</span></a></span></span><span class="hs-special">)</span><span>      </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Role -&gt; Type -&gt; MCoercion -&gt; KindCoercion
</span><a href="GHC.Core.TyCo.Rep.html#GRefl"><span class="hs-identifier hs-var">GRefl</span></a></span><span> </span><span class="annot"><span class="annottext">Role
</span><a href="#local-6989586621680847428"><span class="hs-identifier hs-var">r</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">TidyEnv -&gt; Type -&gt; Type
</span><a href="GHC.Core.TyCo.Tidy.html#tidyType"><span class="hs-identifier hs-var">tidyType</span></a></span><span> </span><span class="annot"><span class="annottext">TidyEnv
</span><a href="#local-6989586621680847439"><span class="hs-identifier hs-var">env</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621680847427"><span class="hs-identifier hs-var">ty</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">(MCoercion -&gt; KindCoercion) -&gt; MCoercion -&gt; KindCoercion
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24%21"><span class="hs-operator hs-var">$!</span></a></span><span> </span><span class="annot"><span class="annottext">MCoercion -&gt; MCoercion
</span><a href="#local-6989586621680847435"><span class="hs-identifier hs-var">go_mco</span></a></span><span> </span><span class="annot"><span class="annottext">MCoercion
</span><a href="#local-6989586621680847426"><span class="hs-identifier hs-var">mco</span></a></span><span>
</span><span id="line-204"></span><span>    </span><span class="annot"><a href="#local-6989586621680847436"><span class="hs-identifier hs-var">go</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#TyConAppCo"><span class="hs-identifier hs-type">TyConAppCo</span></a></span><span> </span><span id="local-6989586621680847424"><span class="annot"><span class="annottext">Role
</span><a href="#local-6989586621680847424"><span class="hs-identifier hs-var">r</span></a></span></span><span> </span><span id="local-6989586621680847423"><span class="annot"><span class="annottext">TyCon
</span><a href="#local-6989586621680847423"><span class="hs-identifier hs-var">tc</span></a></span></span><span> </span><span id="local-6989586621680847422"><span class="annot"><span class="annottext">[KindCoercion]
</span><a href="#local-6989586621680847422"><span class="hs-identifier hs-var">cos</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621680847421"><span class="annot"><span class="annottext">args :: [KindCoercion]
</span><a href="#local-6989586621680847421"><span class="hs-identifier hs-var hs-var">args</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(KindCoercion -&gt; KindCoercion) -&gt; [KindCoercion] -&gt; [KindCoercion]
forall a b. (a -&gt; b) -&gt; [a] -&gt; [b]
</span><a href="../../base/src/GHC.Base.html#map"><span class="hs-identifier hs-var">map</span></a></span><span> </span><span class="annot"><span class="annottext">KindCoercion -&gt; KindCoercion
</span><a href="#local-6989586621680847436"><span class="hs-identifier hs-var">go</span></a></span><span> </span><span class="annot"><span class="annottext">[KindCoercion]
</span><a href="#local-6989586621680847422"><span class="hs-identifier hs-var">cos</span></a></span><span>
</span><span id="line-205"></span><span>                               </span><span class="hs-keyword">in</span><span> </span><span class="annot"><span class="annottext">[KindCoercion]
</span><a href="#local-6989586621680847421"><span class="hs-identifier hs-var">args</span></a></span><span> </span><span class="annot"><span class="annottext">[KindCoercion] -&gt; KindCoercion -&gt; KindCoercion
forall a b. [a] -&gt; b -&gt; b
</span><a href="GHC.Utils.Misc.html#seqList"><span class="hs-operator hs-var">`seqList`</span></a></span><span> </span><span class="annot"><span class="annottext">Role -&gt; TyCon -&gt; [KindCoercion] -&gt; KindCoercion
</span><a href="GHC.Core.TyCo.Rep.html#TyConAppCo"><span class="hs-identifier hs-var">TyConAppCo</span></a></span><span> </span><span class="annot"><span class="annottext">Role
</span><a href="#local-6989586621680847424"><span class="hs-identifier hs-var">r</span></a></span><span> </span><span class="annot"><span class="annottext">TyCon
</span><a href="#local-6989586621680847423"><span class="hs-identifier hs-var">tc</span></a></span><span> </span><span class="annot"><span class="annottext">[KindCoercion]
</span><a href="#local-6989586621680847421"><span class="hs-identifier hs-var">args</span></a></span><span>
</span><span id="line-206"></span><span>    </span><span class="annot"><a href="#local-6989586621680847436"><span class="hs-identifier hs-var">go</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#AppCo"><span class="hs-identifier hs-type">AppCo</span></a></span><span> </span><span id="local-6989586621680847419"><span class="annot"><span class="annottext">KindCoercion
</span><a href="#local-6989586621680847419"><span class="hs-identifier hs-var">co1</span></a></span></span><span> </span><span id="local-6989586621680847418"><span class="annot"><span class="annottext">KindCoercion
</span><a href="#local-6989586621680847418"><span class="hs-identifier hs-var">co2</span></a></span></span><span class="hs-special">)</span><span>       </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">KindCoercion -&gt; KindCoercion -&gt; KindCoercion
</span><a href="GHC.Core.TyCo.Rep.html#AppCo"><span class="hs-identifier hs-var">AppCo</span></a></span><span> </span><span class="annot"><span class="annottext">(KindCoercion -&gt; KindCoercion -&gt; KindCoercion)
-&gt; KindCoercion -&gt; KindCoercion -&gt; KindCoercion
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24%21"><span class="hs-operator hs-var">$!</span></a></span><span> </span><span class="annot"><span class="annottext">KindCoercion -&gt; KindCoercion
</span><a href="#local-6989586621680847436"><span class="hs-identifier hs-var">go</span></a></span><span> </span><span class="annot"><span class="annottext">KindCoercion
</span><a href="#local-6989586621680847419"><span class="hs-identifier hs-var">co1</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">(KindCoercion -&gt; KindCoercion) -&gt; KindCoercion -&gt; KindCoercion
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24%21"><span class="hs-operator hs-var">$!</span></a></span><span> </span><span class="annot"><span class="annottext">KindCoercion -&gt; KindCoercion
</span><a href="#local-6989586621680847436"><span class="hs-identifier hs-var">go</span></a></span><span> </span><span class="annot"><span class="annottext">KindCoercion
</span><a href="#local-6989586621680847418"><span class="hs-identifier hs-var">co2</span></a></span><span>
</span><span id="line-207"></span><span>    </span><span class="annot"><a href="#local-6989586621680847436"><span class="hs-identifier hs-var">go</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#ForAllCo"><span class="hs-identifier hs-type">ForAllCo</span></a></span><span> </span><span id="local-6989586621680847416"><span class="annot"><span class="annottext">TyCoVar
</span><a href="#local-6989586621680847416"><span class="hs-identifier hs-var">tv</span></a></span></span><span> </span><span id="local-6989586621680847415"><span class="annot"><span class="annottext">KindCoercion
</span><a href="#local-6989586621680847415"><span class="hs-identifier hs-var">h</span></a></span></span><span> </span><span id="local-6989586621680847414"><span class="annot"><span class="annottext">KindCoercion
</span><a href="#local-6989586621680847414"><span class="hs-identifier hs-var">co</span></a></span></span><span class="hs-special">)</span><span>    </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">(</span><span class="hs-special">(</span><span class="annot"><span class="annottext">TyCoVar -&gt; KindCoercion -&gt; KindCoercion -&gt; KindCoercion
</span><a href="GHC.Core.TyCo.Rep.html#ForAllCo"><span class="hs-identifier hs-var">ForAllCo</span></a></span><span> </span><span class="annot"><span class="annottext">(TyCoVar -&gt; KindCoercion -&gt; KindCoercion -&gt; KindCoercion)
-&gt; TyCoVar -&gt; KindCoercion -&gt; KindCoercion -&gt; KindCoercion
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24%21"><span class="hs-operator hs-var">$!</span></a></span><span> </span><span class="annot"><span class="annottext">TyCoVar
</span><a href="#local-6989586621680847413"><span class="hs-identifier hs-var">tvp</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">(KindCoercion -&gt; KindCoercion -&gt; KindCoercion)
-&gt; KindCoercion -&gt; KindCoercion -&gt; KindCoercion
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24%21"><span class="hs-operator hs-var">$!</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">KindCoercion -&gt; KindCoercion
</span><a href="#local-6989586621680847436"><span class="hs-identifier hs-var">go</span></a></span><span> </span><span class="annot"><span class="annottext">KindCoercion
</span><a href="#local-6989586621680847415"><span class="hs-identifier hs-var">h</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">(KindCoercion -&gt; KindCoercion) -&gt; KindCoercion -&gt; KindCoercion
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24%21"><span class="hs-operator hs-var">$!</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">TidyEnv -&gt; KindCoercion -&gt; KindCoercion
</span><a href="GHC.Core.TyCo.Tidy.html#tidyCo"><span class="hs-identifier hs-var">tidyCo</span></a></span><span> </span><span class="annot"><span class="annottext">TidyEnv
</span><a href="#local-6989586621680847412"><span class="hs-identifier hs-var">envp</span></a></span><span> </span><span class="annot"><span class="annottext">KindCoercion
</span><a href="#local-6989586621680847414"><span class="hs-identifier hs-var">co</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-208"></span><span>                               </span><span class="hs-keyword">where</span><span> </span><span class="hs-special">(</span><span id="local-6989586621680847412"><span class="annot"><span class="annottext">TidyEnv
</span><a href="#local-6989586621680847412"><span class="hs-identifier hs-var">envp</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621680847413"><span class="annot"><span class="annottext">TyCoVar
</span><a href="#local-6989586621680847413"><span class="hs-identifier hs-var">tvp</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">TidyEnv -&gt; TyCoVar -&gt; (TidyEnv, TyCoVar)
</span><a href="GHC.Core.TyCo.Tidy.html#tidyVarBndr"><span class="hs-identifier hs-var">tidyVarBndr</span></a></span><span> </span><span class="annot"><span class="annottext">TidyEnv
</span><a href="#local-6989586621680847439"><span class="hs-identifier hs-var">env</span></a></span><span> </span><span class="annot"><span class="annottext">TyCoVar
</span><a href="#local-6989586621680847416"><span class="hs-identifier hs-var">tv</span></a></span><span>
</span><span id="line-209"></span><span>            </span><span class="hs-comment">-- the case above duplicates a bit of work in tidying h and the kind</span><span>
</span><span id="line-210"></span><span>            </span><span class="hs-comment">-- of tv. But the alternative is to use coercionKind, which seems worse.</span><span>
</span><span id="line-211"></span><span>    </span><span class="annot"><a href="#local-6989586621680847436"><span class="hs-identifier hs-var">go</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#FunCo"><span class="hs-identifier hs-type">FunCo</span></a></span><span> </span><span id="local-6989586621680847410"><span class="annot"><span class="annottext">Role
</span><a href="#local-6989586621680847410"><span class="hs-identifier hs-var">r</span></a></span></span><span> </span><span id="local-6989586621680847409"><span class="annot"><span class="annottext">KindCoercion
</span><a href="#local-6989586621680847409"><span class="hs-identifier hs-var">w</span></a></span></span><span> </span><span id="local-6989586621680847408"><span class="annot"><span class="annottext">KindCoercion
</span><a href="#local-6989586621680847408"><span class="hs-identifier hs-var">co1</span></a></span></span><span> </span><span id="local-6989586621680847407"><span class="annot"><span class="annottext">KindCoercion
</span><a href="#local-6989586621680847407"><span class="hs-identifier hs-var">co2</span></a></span></span><span class="hs-special">)</span><span>   </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">(</span><span class="hs-special">(</span><span class="annot"><span class="annottext">Role
-&gt; KindCoercion -&gt; KindCoercion -&gt; KindCoercion -&gt; KindCoercion
</span><a href="GHC.Core.TyCo.Rep.html#FunCo"><span class="hs-identifier hs-var">FunCo</span></a></span><span> </span><span class="annot"><span class="annottext">Role
</span><a href="#local-6989586621680847410"><span class="hs-identifier hs-var">r</span></a></span><span> </span><span class="annot"><span class="annottext">(KindCoercion -&gt; KindCoercion -&gt; KindCoercion -&gt; KindCoercion)
-&gt; KindCoercion -&gt; KindCoercion -&gt; KindCoercion -&gt; KindCoercion
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24%21"><span class="hs-operator hs-var">$!</span></a></span><span> </span><span class="annot"><span class="annottext">KindCoercion -&gt; KindCoercion
</span><a href="#local-6989586621680847436"><span class="hs-identifier hs-var">go</span></a></span><span> </span><span class="annot"><span class="annottext">KindCoercion
</span><a href="#local-6989586621680847409"><span class="hs-identifier hs-var">w</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">(KindCoercion -&gt; KindCoercion -&gt; KindCoercion)
-&gt; KindCoercion -&gt; KindCoercion -&gt; KindCoercion
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24%21"><span class="hs-operator hs-var">$!</span></a></span><span> </span><span class="annot"><span class="annottext">KindCoercion -&gt; KindCoercion
</span><a href="#local-6989586621680847436"><span class="hs-identifier hs-var">go</span></a></span><span> </span><span class="annot"><span class="annottext">KindCoercion
</span><a href="#local-6989586621680847408"><span class="hs-identifier hs-var">co1</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">(KindCoercion -&gt; KindCoercion) -&gt; KindCoercion -&gt; KindCoercion
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24%21"><span class="hs-operator hs-var">$!</span></a></span><span> </span><span class="annot"><span class="annottext">KindCoercion -&gt; KindCoercion
</span><a href="#local-6989586621680847436"><span class="hs-identifier hs-var">go</span></a></span><span> </span><span class="annot"><span class="annottext">KindCoercion
</span><a href="#local-6989586621680847407"><span class="hs-identifier hs-var">co2</span></a></span><span>
</span><span id="line-212"></span><span>    </span><span class="annot"><a href="#local-6989586621680847436"><span class="hs-identifier hs-var">go</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#CoVarCo"><span class="hs-identifier hs-type">CoVarCo</span></a></span><span> </span><span id="local-6989586621680847405"><span class="annot"><span class="annottext">TyCoVar
</span><a href="#local-6989586621680847405"><span class="hs-identifier hs-var">cv</span></a></span></span><span class="hs-special">)</span><span>          </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">VarEnv TyCoVar -&gt; TyCoVar -&gt; Maybe TyCoVar
forall a. VarEnv a -&gt; TyCoVar -&gt; Maybe a
</span><a href="GHC.Types.Var.Env.html#lookupVarEnv"><span class="hs-identifier hs-var">lookupVarEnv</span></a></span><span> </span><span class="annot"><span class="annottext">VarEnv TyCoVar
</span><a href="#local-6989586621680847438"><span class="hs-identifier hs-var">subst</span></a></span><span> </span><span class="annot"><span class="annottext">TyCoVar
</span><a href="#local-6989586621680847405"><span class="hs-identifier hs-var">cv</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-213"></span><span>                                 </span><span class="annot"><span class="annottext">Maybe TyCoVar
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span>  </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">TyCoVar -&gt; KindCoercion
</span><a href="GHC.Core.TyCo.Rep.html#CoVarCo"><span class="hs-identifier hs-var">CoVarCo</span></a></span><span> </span><span class="annot"><span class="annottext">TyCoVar
</span><a href="#local-6989586621680847405"><span class="hs-identifier hs-var">cv</span></a></span><span>
</span><span id="line-214"></span><span>                                 </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-type">Just</span></a></span><span> </span><span id="local-6989586621680847404"><span class="annot"><span class="annottext">TyCoVar
</span><a href="#local-6989586621680847404"><span class="hs-identifier hs-var">cv'</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">TyCoVar -&gt; KindCoercion
</span><a href="GHC.Core.TyCo.Rep.html#CoVarCo"><span class="hs-identifier hs-var">CoVarCo</span></a></span><span> </span><span class="annot"><span class="annottext">TyCoVar
</span><a href="#local-6989586621680847404"><span class="hs-identifier hs-var">cv'</span></a></span><span>
</span><span id="line-215"></span><span>    </span><span class="annot"><a href="#local-6989586621680847436"><span class="hs-identifier hs-var">go</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#HoleCo"><span class="hs-identifier hs-type">HoleCo</span></a></span><span> </span><span id="local-6989586621680847402"><span class="annot"><span class="annottext">CoercionHole
</span><a href="#local-6989586621680847402"><span class="hs-identifier hs-var">h</span></a></span></span><span class="hs-special">)</span><span>            </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">CoercionHole -&gt; KindCoercion
</span><a href="GHC.Core.TyCo.Rep.html#HoleCo"><span class="hs-identifier hs-var">HoleCo</span></a></span><span> </span><span class="annot"><span class="annottext">CoercionHole
</span><a href="#local-6989586621680847402"><span class="hs-identifier hs-var">h</span></a></span><span>
</span><span id="line-216"></span><span>    </span><span class="annot"><a href="#local-6989586621680847436"><span class="hs-identifier hs-var">go</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#AxiomInstCo"><span class="hs-identifier hs-type">AxiomInstCo</span></a></span><span> </span><span id="local-6989586621680847400"><span class="annot"><span class="annottext">CoAxiom Branched
</span><a href="#local-6989586621680847400"><span class="hs-identifier hs-var">con</span></a></span></span><span> </span><span id="local-6989586621680847399"><span class="annot"><span class="annottext">BranchIndex
</span><a href="#local-6989586621680847399"><span class="hs-identifier hs-var">ind</span></a></span></span><span> </span><span id="local-6989586621680847398"><span class="annot"><span class="annottext">[KindCoercion]
</span><a href="#local-6989586621680847398"><span class="hs-identifier hs-var">cos</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621680847397"><span class="annot"><span class="annottext">args :: [KindCoercion]
</span><a href="#local-6989586621680847397"><span class="hs-identifier hs-var hs-var">args</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(KindCoercion -&gt; KindCoercion) -&gt; [KindCoercion] -&gt; [KindCoercion]
forall a b. (a -&gt; b) -&gt; [a] -&gt; [b]
</span><a href="../../base/src/GHC.Base.html#map"><span class="hs-identifier hs-var">map</span></a></span><span> </span><span class="annot"><span class="annottext">KindCoercion -&gt; KindCoercion
</span><a href="#local-6989586621680847436"><span class="hs-identifier hs-var">go</span></a></span><span> </span><span class="annot"><span class="annottext">[KindCoercion]
</span><a href="#local-6989586621680847398"><span class="hs-identifier hs-var">cos</span></a></span><span>
</span><span id="line-217"></span><span>                               </span><span class="hs-keyword">in</span><span>  </span><span class="annot"><span class="annottext">[KindCoercion]
</span><a href="#local-6989586621680847397"><span class="hs-identifier hs-var">args</span></a></span><span> </span><span class="annot"><span class="annottext">[KindCoercion] -&gt; KindCoercion -&gt; KindCoercion
forall a b. [a] -&gt; b -&gt; b
</span><a href="GHC.Utils.Misc.html#seqList"><span class="hs-operator hs-var">`seqList`</span></a></span><span> </span><span class="annot"><span class="annottext">CoAxiom Branched -&gt; BranchIndex -&gt; [KindCoercion] -&gt; KindCoercion
</span><a href="GHC.Core.TyCo.Rep.html#AxiomInstCo"><span class="hs-identifier hs-var">AxiomInstCo</span></a></span><span> </span><span class="annot"><span class="annottext">CoAxiom Branched
</span><a href="#local-6989586621680847400"><span class="hs-identifier hs-var">con</span></a></span><span> </span><span class="annot"><span class="annottext">BranchIndex
</span><a href="#local-6989586621680847399"><span class="hs-identifier hs-var">ind</span></a></span><span> </span><span class="annot"><span class="annottext">[KindCoercion]
</span><a href="#local-6989586621680847397"><span class="hs-identifier hs-var">args</span></a></span><span>
</span><span id="line-218"></span><span>    </span><span class="annot"><a href="#local-6989586621680847436"><span class="hs-identifier hs-var">go</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#UnivCo"><span class="hs-identifier hs-type">UnivCo</span></a></span><span> </span><span id="local-6989586621680847395"><span class="annot"><span class="annottext">UnivCoProvenance
</span><a href="#local-6989586621680847395"><span class="hs-identifier hs-var">p</span></a></span></span><span> </span><span id="local-6989586621680847394"><span class="annot"><span class="annottext">Role
</span><a href="#local-6989586621680847394"><span class="hs-identifier hs-var">r</span></a></span></span><span> </span><span id="local-6989586621680847393"><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621680847393"><span class="hs-identifier hs-var">t1</span></a></span></span><span> </span><span id="local-6989586621680847392"><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621680847392"><span class="hs-identifier hs-var">t2</span></a></span></span><span class="hs-special">)</span><span>    </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">(</span><span class="hs-special">(</span><span class="hs-special">(</span><span class="annot"><span class="annottext">UnivCoProvenance -&gt; Role -&gt; Type -&gt; Type -&gt; KindCoercion
</span><a href="GHC.Core.TyCo.Rep.html#UnivCo"><span class="hs-identifier hs-var">UnivCo</span></a></span><span> </span><span class="annot"><span class="annottext">(UnivCoProvenance -&gt; Role -&gt; Type -&gt; Type -&gt; KindCoercion)
-&gt; UnivCoProvenance -&gt; Role -&gt; Type -&gt; Type -&gt; KindCoercion
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24%21"><span class="hs-operator hs-var">$!</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">UnivCoProvenance -&gt; UnivCoProvenance
</span><a href="#local-6989586621680847391"><span class="hs-identifier hs-var">go_prov</span></a></span><span> </span><span class="annot"><span class="annottext">UnivCoProvenance
</span><a href="#local-6989586621680847395"><span class="hs-identifier hs-var">p</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">(Role -&gt; Type -&gt; Type -&gt; KindCoercion)
-&gt; Role -&gt; Type -&gt; Type -&gt; KindCoercion
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24%21"><span class="hs-operator hs-var">$!</span></a></span><span> </span><span class="annot"><span class="annottext">Role
</span><a href="#local-6989586621680847394"><span class="hs-identifier hs-var">r</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">(Type -&gt; Type -&gt; KindCoercion) -&gt; Type -&gt; Type -&gt; KindCoercion
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24%21"><span class="hs-operator hs-var">$!</span></a></span><span>
</span><span id="line-219"></span><span>                                </span><span class="annot"><span class="annottext">TidyEnv -&gt; Type -&gt; Type
</span><a href="GHC.Core.TyCo.Tidy.html#tidyType"><span class="hs-identifier hs-var">tidyType</span></a></span><span> </span><span class="annot"><span class="annottext">TidyEnv
</span><a href="#local-6989586621680847439"><span class="hs-identifier hs-var">env</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621680847393"><span class="hs-identifier hs-var">t1</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">(Type -&gt; KindCoercion) -&gt; Type -&gt; KindCoercion
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24%21"><span class="hs-operator hs-var">$!</span></a></span><span> </span><span class="annot"><span class="annottext">TidyEnv -&gt; Type -&gt; Type
</span><a href="GHC.Core.TyCo.Tidy.html#tidyType"><span class="hs-identifier hs-var">tidyType</span></a></span><span> </span><span class="annot"><span class="annottext">TidyEnv
</span><a href="#local-6989586621680847439"><span class="hs-identifier hs-var">env</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621680847392"><span class="hs-identifier hs-var">t2</span></a></span><span>
</span><span id="line-220"></span><span>    </span><span class="annot"><a href="#local-6989586621680847436"><span class="hs-identifier hs-var">go</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#SymCo"><span class="hs-identifier hs-type">SymCo</span></a></span><span> </span><span id="local-6989586621680847389"><span class="annot"><span class="annottext">KindCoercion
</span><a href="#local-6989586621680847389"><span class="hs-identifier hs-var">co</span></a></span></span><span class="hs-special">)</span><span>            </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">KindCoercion -&gt; KindCoercion
</span><a href="GHC.Core.TyCo.Rep.html#SymCo"><span class="hs-identifier hs-var">SymCo</span></a></span><span> </span><span class="annot"><span class="annottext">(KindCoercion -&gt; KindCoercion) -&gt; KindCoercion -&gt; KindCoercion
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24%21"><span class="hs-operator hs-var">$!</span></a></span><span> </span><span class="annot"><span class="annottext">KindCoercion -&gt; KindCoercion
</span><a href="#local-6989586621680847436"><span class="hs-identifier hs-var">go</span></a></span><span> </span><span class="annot"><span class="annottext">KindCoercion
</span><a href="#local-6989586621680847389"><span class="hs-identifier hs-var">co</span></a></span><span>
</span><span id="line-221"></span><span>    </span><span class="annot"><a href="#local-6989586621680847436"><span class="hs-identifier hs-var">go</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#TransCo"><span class="hs-identifier hs-type">TransCo</span></a></span><span> </span><span id="local-6989586621680847387"><span class="annot"><span class="annottext">KindCoercion
</span><a href="#local-6989586621680847387"><span class="hs-identifier hs-var">co1</span></a></span></span><span> </span><span id="local-6989586621680847386"><span class="annot"><span class="annottext">KindCoercion
</span><a href="#local-6989586621680847386"><span class="hs-identifier hs-var">co2</span></a></span></span><span class="hs-special">)</span><span>     </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">KindCoercion -&gt; KindCoercion -&gt; KindCoercion
</span><a href="GHC.Core.TyCo.Rep.html#TransCo"><span class="hs-identifier hs-var">TransCo</span></a></span><span> </span><span class="annot"><span class="annottext">(KindCoercion -&gt; KindCoercion -&gt; KindCoercion)
-&gt; KindCoercion -&gt; KindCoercion -&gt; KindCoercion
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24%21"><span class="hs-operator hs-var">$!</span></a></span><span> </span><span class="annot"><span class="annottext">KindCoercion -&gt; KindCoercion
</span><a href="#local-6989586621680847436"><span class="hs-identifier hs-var">go</span></a></span><span> </span><span class="annot"><span class="annottext">KindCoercion
</span><a href="#local-6989586621680847387"><span class="hs-identifier hs-var">co1</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">(KindCoercion -&gt; KindCoercion) -&gt; KindCoercion -&gt; KindCoercion
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24%21"><span class="hs-operator hs-var">$!</span></a></span><span> </span><span class="annot"><span class="annottext">KindCoercion -&gt; KindCoercion
</span><a href="#local-6989586621680847436"><span class="hs-identifier hs-var">go</span></a></span><span> </span><span class="annot"><span class="annottext">KindCoercion
</span><a href="#local-6989586621680847386"><span class="hs-identifier hs-var">co2</span></a></span><span>
</span><span id="line-222"></span><span>    </span><span class="annot"><a href="#local-6989586621680847436"><span class="hs-identifier hs-var">go</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#NthCo"><span class="hs-identifier hs-type">NthCo</span></a></span><span> </span><span id="local-6989586621680847384"><span class="annot"><span class="annottext">Role
</span><a href="#local-6989586621680847384"><span class="hs-identifier hs-var">r</span></a></span></span><span> </span><span id="local-6989586621680847383"><span class="annot"><span class="annottext">BranchIndex
</span><a href="#local-6989586621680847383"><span class="hs-identifier hs-var">d</span></a></span></span><span> </span><span id="local-6989586621680847382"><span class="annot"><span class="annottext">KindCoercion
</span><a href="#local-6989586621680847382"><span class="hs-identifier hs-var">co</span></a></span></span><span class="hs-special">)</span><span>        </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Role -&gt; BranchIndex -&gt; KindCoercion -&gt; KindCoercion
</span><a href="GHC.Core.TyCo.Rep.html#NthCo"><span class="hs-identifier hs-var">NthCo</span></a></span><span> </span><span class="annot"><span class="annottext">Role
</span><a href="#local-6989586621680847384"><span class="hs-identifier hs-var">r</span></a></span><span> </span><span class="annot"><span class="annottext">BranchIndex
</span><a href="#local-6989586621680847383"><span class="hs-identifier hs-var">d</span></a></span><span> </span><span class="annot"><span class="annottext">(KindCoercion -&gt; KindCoercion) -&gt; KindCoercion -&gt; KindCoercion
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24%21"><span class="hs-operator hs-var">$!</span></a></span><span> </span><span class="annot"><span class="annottext">KindCoercion -&gt; KindCoercion
</span><a href="#local-6989586621680847436"><span class="hs-identifier hs-var">go</span></a></span><span> </span><span class="annot"><span class="annottext">KindCoercion
</span><a href="#local-6989586621680847382"><span class="hs-identifier hs-var">co</span></a></span><span>
</span><span id="line-223"></span><span>    </span><span class="annot"><a href="#local-6989586621680847436"><span class="hs-identifier hs-var">go</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#LRCo"><span class="hs-identifier hs-type">LRCo</span></a></span><span> </span><span id="local-6989586621680847380"><span class="annot"><span class="annottext">LeftOrRight
</span><a href="#local-6989586621680847380"><span class="hs-identifier hs-var">lr</span></a></span></span><span> </span><span id="local-6989586621680847379"><span class="annot"><span class="annottext">KindCoercion
</span><a href="#local-6989586621680847379"><span class="hs-identifier hs-var">co</span></a></span></span><span class="hs-special">)</span><span>          </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">LeftOrRight -&gt; KindCoercion -&gt; KindCoercion
</span><a href="GHC.Core.TyCo.Rep.html#LRCo"><span class="hs-identifier hs-var">LRCo</span></a></span><span> </span><span class="annot"><span class="annottext">LeftOrRight
</span><a href="#local-6989586621680847380"><span class="hs-identifier hs-var">lr</span></a></span><span> </span><span class="annot"><span class="annottext">(KindCoercion -&gt; KindCoercion) -&gt; KindCoercion -&gt; KindCoercion
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24%21"><span class="hs-operator hs-var">$!</span></a></span><span> </span><span class="annot"><span class="annottext">KindCoercion -&gt; KindCoercion
</span><a href="#local-6989586621680847436"><span class="hs-identifier hs-var">go</span></a></span><span> </span><span class="annot"><span class="annottext">KindCoercion
</span><a href="#local-6989586621680847379"><span class="hs-identifier hs-var">co</span></a></span><span>
</span><span id="line-224"></span><span>    </span><span class="annot"><a href="#local-6989586621680847436"><span class="hs-identifier hs-var">go</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#InstCo"><span class="hs-identifier hs-type">InstCo</span></a></span><span> </span><span id="local-6989586621680847377"><span class="annot"><span class="annottext">KindCoercion
</span><a href="#local-6989586621680847377"><span class="hs-identifier hs-var">co</span></a></span></span><span> </span><span id="local-6989586621680847376"><span class="annot"><span class="annottext">KindCoercion
</span><a href="#local-6989586621680847376"><span class="hs-identifier hs-var">ty</span></a></span></span><span class="hs-special">)</span><span>        </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">KindCoercion -&gt; KindCoercion -&gt; KindCoercion
</span><a href="GHC.Core.TyCo.Rep.html#InstCo"><span class="hs-identifier hs-var">InstCo</span></a></span><span> </span><span class="annot"><span class="annottext">(KindCoercion -&gt; KindCoercion -&gt; KindCoercion)
-&gt; KindCoercion -&gt; KindCoercion -&gt; KindCoercion
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24%21"><span class="hs-operator hs-var">$!</span></a></span><span> </span><span class="annot"><span class="annottext">KindCoercion -&gt; KindCoercion
</span><a href="#local-6989586621680847436"><span class="hs-identifier hs-var">go</span></a></span><span> </span><span class="annot"><span class="annottext">KindCoercion
</span><a href="#local-6989586621680847377"><span class="hs-identifier hs-var">co</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">(KindCoercion -&gt; KindCoercion) -&gt; KindCoercion -&gt; KindCoercion
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24%21"><span class="hs-operator hs-var">$!</span></a></span><span> </span><span class="annot"><span class="annottext">KindCoercion -&gt; KindCoercion
</span><a href="#local-6989586621680847436"><span class="hs-identifier hs-var">go</span></a></span><span> </span><span class="annot"><span class="annottext">KindCoercion
</span><a href="#local-6989586621680847376"><span class="hs-identifier hs-var">ty</span></a></span><span>
</span><span id="line-225"></span><span>    </span><span class="annot"><a href="#local-6989586621680847436"><span class="hs-identifier hs-var">go</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#KindCo"><span class="hs-identifier hs-type">KindCo</span></a></span><span> </span><span id="local-6989586621680847374"><span class="annot"><span class="annottext">KindCoercion
</span><a href="#local-6989586621680847374"><span class="hs-identifier hs-var">co</span></a></span></span><span class="hs-special">)</span><span>           </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">KindCoercion -&gt; KindCoercion
</span><a href="GHC.Core.TyCo.Rep.html#KindCo"><span class="hs-identifier hs-var">KindCo</span></a></span><span> </span><span class="annot"><span class="annottext">(KindCoercion -&gt; KindCoercion) -&gt; KindCoercion -&gt; KindCoercion
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24%21"><span class="hs-operator hs-var">$!</span></a></span><span> </span><span class="annot"><span class="annottext">KindCoercion -&gt; KindCoercion
</span><a href="#local-6989586621680847436"><span class="hs-identifier hs-var">go</span></a></span><span> </span><span class="annot"><span class="annottext">KindCoercion
</span><a href="#local-6989586621680847374"><span class="hs-identifier hs-var">co</span></a></span><span>
</span><span id="line-226"></span><span>    </span><span class="annot"><a href="#local-6989586621680847436"><span class="hs-identifier hs-var">go</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#SubCo"><span class="hs-identifier hs-type">SubCo</span></a></span><span> </span><span id="local-6989586621680847372"><span class="annot"><span class="annottext">KindCoercion
</span><a href="#local-6989586621680847372"><span class="hs-identifier hs-var">co</span></a></span></span><span class="hs-special">)</span><span>            </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">KindCoercion -&gt; KindCoercion
</span><a href="GHC.Core.TyCo.Rep.html#SubCo"><span class="hs-identifier hs-var">SubCo</span></a></span><span> </span><span class="annot"><span class="annottext">(KindCoercion -&gt; KindCoercion) -&gt; KindCoercion -&gt; KindCoercion
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24%21"><span class="hs-operator hs-var">$!</span></a></span><span> </span><span class="annot"><span class="annottext">KindCoercion -&gt; KindCoercion
</span><a href="#local-6989586621680847436"><span class="hs-identifier hs-var">go</span></a></span><span> </span><span class="annot"><span class="annottext">KindCoercion
</span><a href="#local-6989586621680847372"><span class="hs-identifier hs-var">co</span></a></span><span>
</span><span id="line-227"></span><span>    </span><span class="annot"><a href="#local-6989586621680847436"><span class="hs-identifier hs-var">go</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#AxiomRuleCo"><span class="hs-identifier hs-type">AxiomRuleCo</span></a></span><span> </span><span id="local-6989586621680847370"><span class="annot"><span class="annottext">CoAxiomRule
</span><a href="#local-6989586621680847370"><span class="hs-identifier hs-var">ax</span></a></span></span><span> </span><span id="local-6989586621680847369"><span class="annot"><span class="annottext">[KindCoercion]
</span><a href="#local-6989586621680847369"><span class="hs-identifier hs-var">cos</span></a></span></span><span class="hs-special">)</span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621680847368"><span class="annot"><span class="annottext">cos1 :: [KindCoercion]
</span><a href="#local-6989586621680847368"><span class="hs-identifier hs-var hs-var">cos1</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">TidyEnv -&gt; [KindCoercion] -&gt; [KindCoercion]
</span><a href="GHC.Core.TyCo.Tidy.html#tidyCos"><span class="hs-identifier hs-var">tidyCos</span></a></span><span> </span><span class="annot"><span class="annottext">TidyEnv
</span><a href="#local-6989586621680847439"><span class="hs-identifier hs-var">env</span></a></span><span> </span><span class="annot"><span class="annottext">[KindCoercion]
</span><a href="#local-6989586621680847369"><span class="hs-identifier hs-var">cos</span></a></span><span>
</span><span id="line-228"></span><span>                               </span><span class="hs-keyword">in</span><span> </span><span class="annot"><span class="annottext">[KindCoercion]
</span><a href="#local-6989586621680847368"><span class="hs-identifier hs-var">cos1</span></a></span><span> </span><span class="annot"><span class="annottext">[KindCoercion] -&gt; KindCoercion -&gt; KindCoercion
forall a b. [a] -&gt; b -&gt; b
</span><a href="GHC.Utils.Misc.html#seqList"><span class="hs-operator hs-var">`seqList`</span></a></span><span> </span><span class="annot"><span class="annottext">CoAxiomRule -&gt; [KindCoercion] -&gt; KindCoercion
</span><a href="GHC.Core.TyCo.Rep.html#AxiomRuleCo"><span class="hs-identifier hs-var">AxiomRuleCo</span></a></span><span> </span><span class="annot"><span class="annottext">CoAxiomRule
</span><a href="#local-6989586621680847370"><span class="hs-identifier hs-var">ax</span></a></span><span> </span><span class="annot"><span class="annottext">[KindCoercion]
</span><a href="#local-6989586621680847368"><span class="hs-identifier hs-var">cos1</span></a></span><span>
</span><span id="line-229"></span><span>
</span><span id="line-230"></span><span>    </span><span id="local-6989586621680847391"><span class="annot"><span class="annottext">go_prov :: UnivCoProvenance -&gt; UnivCoProvenance
</span><a href="#local-6989586621680847391"><span class="hs-identifier hs-var hs-var">go_prov</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#PhantomProv"><span class="hs-identifier hs-type">PhantomProv</span></a></span><span> </span><span id="local-6989586621680847366"><span class="annot"><span class="annottext">KindCoercion
</span><a href="#local-6989586621680847366"><span class="hs-identifier hs-var">co</span></a></span></span><span class="hs-special">)</span><span>    </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">KindCoercion -&gt; UnivCoProvenance
</span><a href="GHC.Core.TyCo.Rep.html#PhantomProv"><span class="hs-identifier hs-var">PhantomProv</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">KindCoercion -&gt; KindCoercion
</span><a href="#local-6989586621680847436"><span class="hs-identifier hs-var">go</span></a></span><span> </span><span class="annot"><span class="annottext">KindCoercion
</span><a href="#local-6989586621680847366"><span class="hs-identifier hs-var">co</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-231"></span><span>    </span><span class="annot"><a href="#local-6989586621680847391"><span class="hs-identifier hs-var">go_prov</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#ProofIrrelProv"><span class="hs-identifier hs-type">ProofIrrelProv</span></a></span><span> </span><span id="local-6989586621680847364"><span class="annot"><span class="annottext">KindCoercion
</span><a href="#local-6989586621680847364"><span class="hs-identifier hs-var">co</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">KindCoercion -&gt; UnivCoProvenance
</span><a href="GHC.Core.TyCo.Rep.html#ProofIrrelProv"><span class="hs-identifier hs-var">ProofIrrelProv</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">KindCoercion -&gt; KindCoercion
</span><a href="#local-6989586621680847436"><span class="hs-identifier hs-var">go</span></a></span><span> </span><span class="annot"><span class="annottext">KindCoercion
</span><a href="#local-6989586621680847364"><span class="hs-identifier hs-var">co</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-232"></span><span>    </span><span class="annot"><a href="#local-6989586621680847391"><span class="hs-identifier hs-var">go_prov</span></a></span><span> </span><span id="local-6989586621680847363"><span class="annot"><span class="annottext">p :: UnivCoProvenance
</span><a href="#local-6989586621680847363"><span class="hs-identifier hs-var">p</span></a></span></span><span class="hs-glyph">@</span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#PluginProv"><span class="hs-identifier hs-type">PluginProv</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-identifier">_</span></span><span class="hs-special">)</span><span>    </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">UnivCoProvenance
</span><a href="#local-6989586621680847363"><span class="hs-identifier hs-var">p</span></a></span><span>
</span><span id="line-233"></span><span>    </span><span class="annot"><a href="#local-6989586621680847391"><span class="hs-identifier hs-var">go_prov</span></a></span><span> </span><span id="local-6989586621680847361"><span class="annot"><span class="annottext">p :: UnivCoProvenance
</span><a href="#local-6989586621680847361"><span class="hs-identifier hs-var">p</span></a></span></span><span class="hs-glyph">@</span><span class="annot"><span class="annottext">UnivCoProvenance
</span><a href="GHC.Core.TyCo.Rep.html#CorePrepProv"><span class="hs-identifier hs-var">CorePrepProv</span></a></span><span>      </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">UnivCoProvenance
</span><a href="#local-6989586621680847361"><span class="hs-identifier hs-var">p</span></a></span><span>
</span><span id="line-234"></span><span>
</span><span id="line-235"></span><span class="annot"><a href="GHC.Core.TyCo.Tidy.html#tidyCos"><span class="hs-identifier hs-type">tidyCos</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Types.Var.Env.html#TidyEnv"><span class="hs-identifier hs-type">TidyEnv</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#Coercion"><span class="hs-identifier hs-type">Coercion</span></a></span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#Coercion"><span class="hs-identifier hs-type">Coercion</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-236"></span><span id="tidyCos"><span class="annot"><span class="annottext">tidyCos :: TidyEnv -&gt; [KindCoercion] -&gt; [KindCoercion]
</span><a href="GHC.Core.TyCo.Tidy.html#tidyCos"><span class="hs-identifier hs-var hs-var">tidyCos</span></a></span></span><span> </span><span id="local-6989586621680847359"><span class="annot"><span class="annottext">TidyEnv
</span><a href="#local-6989586621680847359"><span class="hs-identifier hs-var">env</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(KindCoercion -&gt; KindCoercion) -&gt; [KindCoercion] -&gt; [KindCoercion]
forall a b. (a -&gt; b) -&gt; [a] -&gt; [b]
</span><a href="../../base/src/GHC.Base.html#map"><span class="hs-identifier hs-var">map</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">TidyEnv -&gt; KindCoercion -&gt; KindCoercion
</span><a href="GHC.Core.TyCo.Tidy.html#tidyCo"><span class="hs-identifier hs-var">tidyCo</span></a></span><span> </span><span class="annot"><span class="annottext">TidyEnv
</span><a href="#local-6989586621680847359"><span class="hs-identifier hs-var">env</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-237"></span></pre></body></html>